Skip to content

Commit 5d2aab4

Browse files
committed
---
yaml --- r: 274141 b: refs/heads/stable c: cd1b845 h: refs/heads/master i: 274139: cfe88b4
1 parent 66dd4d0 commit 5d2aab4

File tree

45 files changed

+1037
-965
lines changed

Some content is hidden

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

45 files changed

+1037
-965
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 6aa86e5cd10db5c2dffff4d0d378dbe4cee77e46
32+
refs/heads/stable: cd1b845492e13ae9e0da382dc0ec09d676d2dd59
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ DEPS_rustc_front := std syntax log serialize
102102
DEPS_rustc_lint := rustc log syntax
103103
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
104104
DEPS_rustc_metadata := rustc rustc_front syntax rbml
105-
DEPS_rustc_passes := syntax rustc core
105+
DEPS_rustc_passes := syntax rustc core rustc_front
106106
DEPS_rustc_mir := rustc rustc_front syntax
107107
DEPS_rustc_resolve := arena rustc rustc_front log syntax
108108
DEPS_rustc_platform_intrinsics := rustc rustc_llvm

branches/stable/src/liballoc/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ pub struct Weak<T: ?Sized> {
149149
_ptr: Shared<ArcInner<T>>,
150150
}
151151

152-
#[stable(feature = "rust1", since = "1.0.0")]
152+
#[stable(feature = "arc_weak", since = "1.4.0")]
153153
unsafe impl<T: ?Sized + Sync + Send> Send for Weak<T> {}
154-
#[stable(feature = "rust1", since = "1.0.0")]
154+
#[stable(feature = "arc_weak", since = "1.4.0")]
155155
unsafe impl<T: ?Sized + Sync + Send> Sync for Weak<T> {}
156156

157157
#[unstable(feature = "coerce_unsized", issue = "27732")]
158158
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}
159159

160-
#[stable(feature = "rust1", since = "1.0.0")]
160+
#[stable(feature = "arc_weak", since = "1.4.0")]
161161
impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
162162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163163
write!(f, "(Weak)")
@@ -681,7 +681,7 @@ impl<T: ?Sized> Clone for Weak<T> {
681681
}
682682
}
683683

684-
#[stable(feature = "rust1", since = "1.0.0")]
684+
#[stable(feature = "arc_weak", since = "1.4.0")]
685685
impl<T: ?Sized> Drop for Weak<T> {
686686
/// Drops the `Weak<T>`.
687687
///

branches/stable/src/libcore/str/mod.rs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,34 @@ pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
244244
Ok(unsafe { from_utf8_unchecked(v) })
245245
}
246246

247+
/// Forms a str from a pointer and a length.
248+
///
249+
/// The `len` argument is the number of bytes in the string.
250+
///
251+
/// # Safety
252+
///
253+
/// This function is unsafe as there is no guarantee that the given pointer is
254+
/// valid for `len` bytes, nor whether the lifetime inferred is a suitable
255+
/// lifetime for the returned str.
256+
///
257+
/// The data must be valid UTF-8
258+
///
259+
/// `p` must be non-null, even for zero-length str.
260+
///
261+
/// # Caveat
262+
///
263+
/// The lifetime for the returned str is inferred from its usage. To
264+
/// prevent accidental misuse, it's suggested to tie the lifetime to whichever
265+
/// source lifetime is safe in the context, such as by providing a helper
266+
/// function taking the lifetime of a host value for the str, or by explicit
267+
/// annotation.
268+
/// Performs the same functionality as `from_raw_parts`, except that a mutable
269+
/// str is returned.
270+
///
271+
unsafe fn from_raw_parts_mut<'a>(p: *mut u8, len: usize) -> &'a mut str {
272+
mem::transmute::<&mut [u8], &mut str>(slice::from_raw_parts_mut(p, len))
273+
}
274+
247275
/// Converts a slice of bytes to a string slice without checking
248276
/// that the string contains valid UTF-8.
249277
///
@@ -1843,10 +1871,10 @@ impl StrExt for str {
18431871
// is_char_boundary checks that the index is in [0, .len()]
18441872
if self.is_char_boundary(mid) {
18451873
let len = self.len();
1874+
let ptr = self.as_ptr() as *mut u8;
18461875
unsafe {
1847-
let self2: &mut str = mem::transmute_copy(&self);
1848-
(self.slice_mut_unchecked(0, mid),
1849-
self2.slice_mut_unchecked(mid, len))
1876+
(from_raw_parts_mut(ptr, mid),
1877+
from_raw_parts_mut(ptr.offset(mid as isize), len - mid))
18501878
}
18511879
} else {
18521880
slice_error_fail(self, 0, mid)

0 commit comments

Comments
 (0)