Skip to content

Commit 0a440b1

Browse files
committedDec 21, 2019
Auto merge of #67485 - Centril:rollup-gt0opvr, r=Centril
Rollup of 7 pull requests Successful merges: - #67059 (Fix too restrictive checks on Drop impls) - #67355 (Merge `ast::Mutability` and `mir::Mutability`) - #67393 (Enable opting out of specific default LLVM arguments.) - #67422 (Cleanup err codes) - #67462 (Make ptr::slice_from_raw_parts a const fn available under a feature flag) - #67467 (Test slice patterns more) - #67478 (Fix src/libcore/str/mod.rs doc comments) Failed merges: r? @ghost
2 parents c64eecf + 466fdea commit 0a440b1

File tree

113 files changed

+1301
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1301
-376
lines changed
 

‎src/libcore/ptr/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ pub(crate) struct FatPtr<T> {
259259
/// ```
260260
#[inline]
261261
#[unstable(feature = "slice_from_raw_parts", reason = "recently added", issue = "36925")]
262-
pub fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
262+
#[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
263+
pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
263264
unsafe { Repr { raw: FatPtr { data, len } }.rust }
264265
}
265266

@@ -275,7 +276,8 @@ pub fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
275276
/// [`from_raw_parts_mut`]: ../../std/slice/fn.from_raw_parts_mut.html
276277
#[inline]
277278
#[unstable(feature = "slice_from_raw_parts", reason = "recently added", issue = "36925")]
278-
pub fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
279+
#[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
280+
pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
279281
unsafe { Repr { raw: FatPtr { data, len } }.rust_mut }
280282
}
281283

‎src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ impl str {
23252325
i.get_mut(self)
23262326
}
23272327

2328-
/// Returns a unchecked subslice of `str`.
2328+
/// Returns an unchecked subslice of `str`.
23292329
///
23302330
/// This is the unchecked alternative to indexing the `str`.
23312331
///

0 commit comments

Comments
 (0)
Please sign in to comment.