File tree 1 file changed +7
-9
lines changed
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1030,28 +1030,26 @@ struct Bar2; // ok!
1030
1030
"## ,
1031
1031
1032
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.
1033
+ The `self` keyword cannot appear alone as the last segment in a `use`
1034
+ declaration.
1037
1035
1038
1036
Example of erroneous code:
1039
1037
1040
1038
```compile_fail
1041
1039
use std::fmt::self; // error: `self` imports are only allowed within a { } list
1042
1040
```
1043
1041
1044
- If you only want to import the namespace, do so directly:
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:
1045
1044
1046
1045
```
1047
- use std::fmt;
1046
+ use std::fmt::{self, Debug} ;
1048
1047
```
1049
1048
1050
- If you also want to import members in the same statement, you may use the brace
1051
- syntax:
1049
+ If you only want to import the namespace, do so directly:
1052
1050
1053
1051
```
1054
- use std::fmt::{self, Debug} ;
1052
+ use std::fmt;
1055
1053
```
1056
1054
"## ,
1057
1055
You can’t perform that action at this time.
0 commit comments