Skip to content

Commit 5786091

Browse files
committed
---
yaml --- r: 233202 b: refs/heads/beta c: 5309fbb h: refs/heads/master v: v3
1 parent ffd60a5 commit 5786091

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 47041fe28920326807b29c1246ca9712e184f885
26+
refs/heads/beta: 5309fbb6c91b8667a016647484ab2ab73d8bf0dd
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libcollections/str.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -479,19 +479,6 @@ impl str {
479479
core_str::StrExt::as_bytes(self)
480480
}
481481

482-
/// Converts `self` to a mutable byte slice.
483-
///
484-
/// # Unsafety
485-
///
486-
/// The `str` type guarantees that its contents are UTF-8 bytes, which can
487-
/// be violated using this function, leading to memory-unsafeties in other
488-
/// string functions.
489-
#[unstable(feature = "str_as_bytes_mut")]
490-
#[inline(always)]
491-
pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
492-
core_str::StrExt::as_bytes_mut(self)
493-
}
494-
495482
/// Returns a raw pointer to the `&str`'s buffer.
496483
///
497484
/// The caller must ensure that the string outlives this pointer, and

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,6 @@ pub trait StrExt {
12641264
fn char_at(&self, i: usize) -> char;
12651265
fn char_at_reverse(&self, i: usize) -> char;
12661266
fn as_bytes<'a>(&'a self) -> &'a [u8];
1267-
unsafe fn as_bytes_mut<'a>(&'a mut self) -> &'a mut [u8];
12681267
fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>;
12691268
fn rfind<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>
12701269
where P::Searcher: ReverseSearcher<'a>;
@@ -1557,11 +1556,6 @@ impl StrExt for str {
15571556
unsafe { mem::transmute(self) }
15581557
}
15591558

1560-
#[inline]
1561-
unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
1562-
mem::transmute(self)
1563-
}
1564-
15651559
fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> {
15661560
pat.into_searcher(self).next_match().map(|(i, _)| i)
15671561
}

branches/beta/src/libstd/ascii.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use prelude::v1::*;
1616

17+
use mem;
1718
use ops::Range;
1819

1920
/// Extension methods for ASCII-subset only operations on owned strings
@@ -185,12 +186,12 @@ impl AsciiExt for str {
185186
}
186187

187188
fn make_ascii_uppercase(&mut self) {
188-
let me: &mut [u8] = unsafe { self.as_bytes_mut() };
189+
let me: &mut [u8] = unsafe { mem::transmute(self) };
189190
me.make_ascii_uppercase()
190191
}
191192

192193
fn make_ascii_lowercase(&mut self) {
193-
let me: &mut [u8] = unsafe { self.as_bytes_mut() };
194+
let me: &mut [u8] = unsafe { mem::transmute(self) };
194195
me.make_ascii_lowercase()
195196
}
196197
}

branches/beta/src/libstd/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@
235235
#![feature(slice_bytes)]
236236
#![feature(slice_patterns)]
237237
#![feature(staged_api)]
238-
#![feature(str_as_bytes_mut)]
239238
#![feature(str_char)]
240239
#![feature(str_internals)]
241240
#![feature(unboxed_closures)]

0 commit comments

Comments
 (0)