File tree Expand file tree Collapse file tree 5 files changed +4
-23
lines changed Expand file tree Collapse file tree 5 files changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
23
23
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
24
24
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
25
25
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26
- refs/heads/beta: 47041fe28920326807b29c1246ca9712e184f885
26
+ refs/heads/beta: 5309fbb6c91b8667a016647484ab2ab73d8bf0dd
27
27
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28
28
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
Original file line number Diff line number Diff line change @@ -479,19 +479,6 @@ impl str {
479
479
core_str:: StrExt :: as_bytes ( self )
480
480
}
481
481
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
-
495
482
/// Returns a raw pointer to the `&str`'s buffer.
496
483
///
497
484
/// The caller must ensure that the string outlives this pointer, and
Original file line number Diff line number Diff line change @@ -1264,7 +1264,6 @@ pub trait StrExt {
1264
1264
fn char_at ( & self , i : usize ) -> char ;
1265
1265
fn char_at_reverse ( & self , i : usize ) -> char ;
1266
1266
fn as_bytes < ' a > ( & ' a self ) -> & ' a [ u8 ] ;
1267
- unsafe fn as_bytes_mut < ' a > ( & ' a mut self ) -> & ' a mut [ u8 ] ;
1268
1267
fn find < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Option < usize > ;
1269
1268
fn rfind < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Option < usize >
1270
1269
where P :: Searcher : ReverseSearcher < ' a > ;
@@ -1557,11 +1556,6 @@ impl StrExt for str {
1557
1556
unsafe { mem:: transmute ( self ) }
1558
1557
}
1559
1558
1560
- #[ inline]
1561
- unsafe fn as_bytes_mut ( & mut self ) -> & mut [ u8 ] {
1562
- mem:: transmute ( self )
1563
- }
1564
-
1565
1559
fn find < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Option < usize > {
1566
1560
pat. into_searcher ( self ) . next_match ( ) . map ( |( i, _) | i)
1567
1561
}
Original file line number Diff line number Diff line change 14
14
15
15
use prelude:: v1:: * ;
16
16
17
+ use mem;
17
18
use ops:: Range ;
18
19
19
20
/// Extension methods for ASCII-subset only operations on owned strings
@@ -185,12 +186,12 @@ impl AsciiExt for str {
185
186
}
186
187
187
188
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 ) } ;
189
190
me. make_ascii_uppercase ( )
190
191
}
191
192
192
193
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 ) } ;
194
195
me. make_ascii_lowercase ( )
195
196
}
196
197
}
Original file line number Diff line number Diff line change 235
235
#![ feature( slice_bytes) ]
236
236
#![ feature( slice_patterns) ]
237
237
#![ feature( staged_api) ]
238
- #![ feature( str_as_bytes_mut) ]
239
238
#![ feature( str_char) ]
240
239
#![ feature( str_internals) ]
241
240
#![ feature( unboxed_closures) ]
You can’t perform that action at this time.
0 commit comments