File tree 2 files changed +61
-0
lines changed
2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ feature( nll) ]
12
+
13
+ struct AtomicRefMut < ' a > {
14
+ value : & ' a mut i32 ,
15
+ borrow : AtomicBorrowRefMut ,
16
+ }
17
+
18
+ struct AtomicBorrowRefMut {
19
+ }
20
+
21
+ impl Drop for AtomicBorrowRefMut {
22
+ fn drop ( & mut self ) {
23
+ }
24
+ }
25
+
26
+ fn map ( orig : AtomicRefMut ) -> AtomicRefMut {
27
+ AtomicRefMut {
28
+ value : orig. value ,
29
+ borrow : orig. borrow ,
30
+ }
31
+ }
32
+
33
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ feature( nll) ]
12
+
13
+ struct MyStruct < ' a > {
14
+ field : & ' a mut ( ) ,
15
+ field2 : WithDrop
16
+ }
17
+
18
+ struct WithDrop ;
19
+
20
+ impl Drop for WithDrop {
21
+ fn drop ( & mut self ) { }
22
+ }
23
+
24
+ impl < ' a > MyStruct < ' a > {
25
+ fn consume ( self ) -> & ' a mut ( ) { self . field }
26
+ }
27
+
28
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments