File tree 7 files changed +137
-0
lines changed
7 files changed +137
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ trait Wedding < ' t > : ' t { }
12
+
13
+ struct Prince < ' kiss , ' SnowWhite > {
14
+ child : Box < Wedding < ' kiss > + ' SnowWhite > , //~ ERROR E0478
15
+ }
16
+
17
+ fn main ( ) {
18
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ use std:: sync:: atomic:: { AtomicUsize , ATOMIC_USIZE_INIT } ;
12
+
13
+ const A : AtomicUsize = ATOMIC_USIZE_INIT ;
14
+ static B : & ' static AtomicUsize = & A ; //~ ERROR E0492
15
+
16
+ fn main ( ) {
17
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ struct Foo {
12
+ a : u32
13
+ }
14
+
15
+ impl Drop for Foo {
16
+ fn drop ( & mut self ) { }
17
+ }
18
+
19
+ const F : Foo = Foo { a : 0 } ; //~ ERROR E0493
20
+
21
+ fn main ( ) {
22
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ struct Foo {
12
+ a : u32
13
+ }
14
+
15
+ static S : Foo = Foo { a : 0 } ;
16
+ static A : & ' static u32 = & S . a ; //~ ERROR E0494
17
+
18
+ fn main ( ) {
19
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ struct Foo < ' a > {
12
+ a : & ' a i32 ,
13
+ }
14
+
15
+ impl < ' a > Foo < ' a > {
16
+ fn f < ' a > ( x : & ' a i32 ) { //~ ERROR E0496
17
+ }
18
+ }
19
+
20
+ fn main ( ) {
21
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ fn main ( ) {
12
+ let mut i = 0 ;
13
+ let mut x = & mut i;
14
+ let mut a = & mut i; //~ ERROR E0499
15
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ fn inside_closure ( x : & mut i32 ) {
12
+ }
13
+
14
+ fn outside_closure ( x : & mut i32 ) {
15
+ }
16
+
17
+ fn foo ( a : & mut i32 ) {
18
+ let bar = || {
19
+ inside_closure ( a)
20
+ } ;
21
+ outside_closure ( a) ; //~ ERROR E0501
22
+ }
23
+
24
+ fn main ( ) {
25
+ }
You can’t perform that action at this time.
0 commit comments