File tree Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
3
3
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4
- refs/heads/try: 77987ba89894997c174ac8b01185c0dc12913fa5
4
+ refs/heads/try: 9370d3a05107bdcac6fb62d3bd5380e1d7c79b5b
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -232,6 +232,18 @@ impl<T:Copy> Cell<T> {
232
232
pub fn as_unsafe_cell ( & self ) -> & UnsafeCell < T > {
233
233
& self . value
234
234
}
235
+
236
+ /// Returns a mutable reference to the underlying data.
237
+ ///
238
+ /// This call borrows `Cell` mutably (at compile-time) which guarantees
239
+ /// that we possess the only reference.
240
+ #[ inline]
241
+ #[ unstable( feature = "cell_get_mut" , issue = "33444" ) ]
242
+ pub fn get_mut ( & mut self ) -> & mut T {
243
+ unsafe {
244
+ & mut * self . value . get ( )
245
+ }
246
+ }
235
247
}
236
248
237
249
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -455,6 +467,18 @@ impl<T: ?Sized> RefCell<T> {
455
467
pub unsafe fn as_unsafe_cell ( & self ) -> & UnsafeCell < T > {
456
468
& self . value
457
469
}
470
+
471
+ /// Returns a mutable reference to the underlying data.
472
+ ///
473
+ /// This call borrows `RefCell` mutably (at compile-time) so there is no
474
+ /// need for dynamic checks.
475
+ #[ inline]
476
+ #[ unstable( feature = "cell_get_mut" , issue="33444" ) ]
477
+ pub fn get_mut ( & mut self ) -> & mut T {
478
+ unsafe {
479
+ & mut * self . value . get ( )
480
+ }
481
+ }
458
482
}
459
483
460
484
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -326,22 +326,6 @@ impl fmt::Debug for CStr {
326
326
}
327
327
}
328
328
329
- #[ stable( feature = "cstr_default" , since = "1.10.0" ) ]
330
- impl < ' a > Default for & ' a CStr {
331
- fn default ( ) -> & ' a CStr {
332
- static SLICE : & ' static [ c_char ] = & [ 0 ] ;
333
- unsafe { CStr :: from_ptr ( SLICE . as_ptr ( ) ) }
334
- }
335
- }
336
-
337
- #[ stable( feature = "cstr_default" , since = "1.10.0" ) ]
338
- impl Default for CString {
339
- fn default ( ) -> CString {
340
- let a: & CStr = Default :: default ( ) ;
341
- a. to_owned ( )
342
- }
343
- }
344
-
345
329
#[ stable( feature = "cstr_borrow" , since = "1.3.0" ) ]
346
330
impl Borrow < CStr > for CString {
347
331
fn borrow ( & self ) -> & CStr { self }
You can’t perform that action at this time.
0 commit comments