File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
branches/stable/src/librustc_resolve Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: c0412bcad69d95e217211bf6be925802004e4b17
32
+ refs/heads/stable: f3a3684614c0baf01e2d22e662b67e6a1408b718
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
Original file line number Diff line number Diff line change 15
15
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
16
16
register_long_diagnostics ! {
17
17
18
+ E0154 : r##"
19
+ Imports (`use` statements) are not allowed after non-item statements, such as
20
+ variable declarations and expression statements.
21
+
22
+ Wrong example:
23
+ ```
24
+ fn f() {
25
+ // Variable declaration before import
26
+ let x = 0;
27
+ use std::io::Read;
28
+ ...
29
+ }
30
+ ```
31
+
32
+ The solution is to declare the imports at the top of the block, function, or
33
+ file.
34
+
35
+ Here is the previous example again, with the correct order:
36
+ ```
37
+ fn f() {
38
+ use std::io::Read;
39
+ let x = 0;
40
+ ...
41
+ }
42
+ ```
43
+
44
+ See the Declaration Statements section of the reference for more information
45
+ about what constitutes an Item declaration and what does not:
46
+
47
+ http://doc.rust-lang.org/reference.html#statements
48
+ "## ,
49
+
18
50
E0317 : r##"
19
51
User-defined types or type parameters cannot shadow the primitive types.
20
52
This error indicates you tried to define a type, struct or enum with the same
@@ -29,7 +61,6 @@ http://doc.rust-lang.org/reference.html#types
29
61
}
30
62
31
63
register_diagnostics ! {
32
- E0154 ,
33
64
E0157 ,
34
65
E0153 ,
35
66
E0251 , // a named type or value has already been imported in this module
You can’t perform that action at this time.
0 commit comments