File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1029,6 +1029,32 @@ struct Bar2; // ok!
1029
1029
```
1030
1030
"## ,
1031
1031
1032
+ E0429 : r##"
1033
+ To import a namespace itself in addition to some of its members, the `self`
1034
+ keyword may appear in a brace-enclosed list as the last segment in a `use`
1035
+ declaration. However, `self` cannot be used alone, without the brace
1036
+ syntax.
1037
+
1038
+ Example of erroneous code:
1039
+
1040
+ ```compile_fail
1041
+ use std::fmt::self; // error: `self` imports are only allowed within a { } list
1042
+ ```
1043
+
1044
+ If you only want to import the namespace, do so directly:
1045
+
1046
+ ```
1047
+ use std::fmt;
1048
+ ```
1049
+
1050
+ If you also want to import members in the same statement, you may use the brace
1051
+ syntax:
1052
+
1053
+ ```
1054
+ use std::fmt::{self, Debug};
1055
+ ```
1056
+ "## ,
1057
+
1032
1058
E0430 : r##"
1033
1059
The `self` import appears more than once in the list. Erroneous code example:
1034
1060
@@ -1235,5 +1261,4 @@ register_diagnostics! {
1235
1261
E0420 , // is not an associated const
1236
1262
E0421 , // unresolved associated const
1237
1263
E0427 , // cannot use `ref` binding mode with ...
1238
- E0429 , // `self` imports are only allowed within a { } list
1239
1264
}
You can’t perform that action at this time.
0 commit comments