File tree Expand file tree Collapse file tree 13 files changed +184
-4
lines changed Expand file tree Collapse file tree 13 files changed +184
-4
lines changed Original file line number Diff line number Diff line change @@ -121,11 +121,11 @@ All statics and constants need to resolve to a value in an acyclic manner.
121
121
122
122
For example, neither of the following can be sensibly compiled:
123
123
124
- ```compile_fail
124
+ ```compile_fail,E0265
125
125
const X: u32 = X;
126
126
```
127
127
128
- ```compile_fail
128
+ ```compile_fail,E0265
129
129
const X: u32 = Y;
130
130
const Y: u32 = X;
131
131
```
@@ -135,7 +135,7 @@ E0267: r##"
135
135
This error indicates the use of a loop keyword (`break` or `continue`) inside a
136
136
closure but outside of any loop. Erroneous code example:
137
137
138
- ```compile_fail
138
+ ```compile_fail,E0267
139
139
let w = || { break; }; // error: `break` inside of a closure
140
140
```
141
141
@@ -159,7 +159,7 @@ This error indicates the use of a loop keyword (`break` or `continue`) outside
159
159
of a loop. Without a loop to break out of or continue in, no sensible action can
160
160
be taken. Erroneous code example:
161
161
162
- ```compile_fail
162
+ ```compile_fail,E0268
163
163
fn some_func() {
164
164
break; // error: `break` outside of loop
165
165
}
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ mod foo {
146
146
}
147
147
148
148
use foo::MyTrait::do_something;
149
+ // error: `do_something` is not directly importable
149
150
150
151
fn main() {}
151
152
```
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
+ mod foo {
12
+ pub trait MyTrait {
13
+ fn do_something ( ) ;
14
+ }
15
+ }
16
+
17
+ use foo:: MyTrait :: do_something; //~ ERROR E0253
18
+
19
+ fn main ( ) { }
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
+ extern crate collections;
12
+
13
+ mod foo {
14
+ pub trait collections {
15
+ fn do_something ( ) ;
16
+ }
17
+ }
18
+
19
+ use foo:: collections; //~ ERROR E0254
20
+
21
+ fn main ( ) { }
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 bar:: foo;
12
+
13
+ fn foo ( ) { } //~ ERROR E0255
14
+
15
+ mod bar {
16
+ pub fn foo ( ) { }
17
+ }
18
+
19
+ fn main ( ) { }
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
+ extern crate collections;
12
+ extern crate libc as collections; //~ ERROR E0259
13
+
14
+ fn main ( ) { }
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
+ extern crate collections;
12
+
13
+ mod collections { //~ ERROR E0260
14
+ pub trait MyTrait {
15
+ fn do_something ( ) ;
16
+ }
17
+ }
18
+
19
+ fn main ( ) { }
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 foo ( x : & ' a str ) { } //~ ERROR E0261
12
+
13
+ struct Foo {
14
+ x : & ' a str , //~ ERROR E0261
15
+ }
16
+
17
+ fn main ( ) { }
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 foo < ' static > ( x : & ' static str ) { } //~ ERROR E0262
12
+
13
+ fn main ( ) { }
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 foo < ' a , ' b , ' a > ( x : & ' a str , y : & ' b str ) { } //~ ERROR E0263
12
+
13
+ fn main ( ) { }
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
+ #![ feature( lang_items) ]
12
+
13
+ extern "C" {
14
+ #[ lang = "cake" ]
15
+ fn cake ( ) ; //~ ERROR E0264
16
+ }
17
+
18
+ fn main ( ) { }
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 w = || { break ; } ; //~ ERROR E0267
13
+ }
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
+ break ; //~ ERROR E0268
13
+ }
You can’t perform that action at this time.
0 commit comments