File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -1029,6 +1029,30 @@ struct Bar2; // ok!
10291029```
10301030"##,
10311031
1032+ E0429: r##"
1033+ The `self` keyword cannot appear alone as the last segment in a `use`
1034+ declaration.
1035+
1036+ Example of erroneous code:
1037+
1038+ ```compile_fail
1039+ use std::fmt::self; // error: `self` imports are only allowed within a { } list
1040+ ```
1041+
1042+ To use a namespace itself in addition to some of its members, `self` may appear
1043+ as part of a brace-enclosed list of imports:
1044+
1045+ ```
1046+ use std::fmt::{self, Debug};
1047+ ```
1048+
1049+ If you only want to import the namespace, do so directly:
1050+
1051+ ```
1052+ use std::fmt;
1053+ ```
1054+ "##,
1055+
10321056E0430: r##"
10331057The `self` import appears more than once in the list. Erroneous code example:
10341058
@@ -1235,5 +1259,4 @@ register_diagnostics! {
12351259 E0420, // is not an associated const
12361260 E0421, // unresolved associated const
12371261 E0427, // cannot use `ref` binding mode with ...
1238- E0429, // `self` imports are only allowed within a { } list
12391262}
You can’t perform that action at this time.
0 commit comments