]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-45829/import-self.stderr
Use `summary_opts()` in another spot
[rust.git] / src / test / ui / issues / issue-45829 / import-self.stderr
1 error: expected identifier, found keyword `self`
2   --> $DIR/import-self.rs:9:12
3    |
4 LL | use foo as self;
5    |            ^^^^ expected identifier, found keyword
6
7 error[E0429]: `self` imports are only allowed within a { } list
8   --> $DIR/import-self.rs:12:8
9    |
10 LL | use foo::self;
11    |        ^^^^^^
12    |
13 help: consider importing the module directly
14    |
15 LL | use foo;
16    |       --
17 help: alternatively, use the multi-path `use` syntax to import `self`
18    |
19 LL | use foo::{self};
20    |          ^    ^
21
22 error[E0255]: the name `foo` is defined multiple times
23   --> $DIR/import-self.rs:6:11
24    |
25 LL | mod foo {
26    | ------- previous definition of the module `foo` here
27 ...
28 LL | use foo::{self};
29    |           ^^^^ `foo` reimported here
30    |
31    = note: `foo` must be defined only once in the type namespace of this module
32 help: you can use `as` to change the binding name of the import
33    |
34 LL | use foo::{self as other_foo};
35    |           ^^^^^^^^^^^^^^^^^
36
37 error[E0255]: the name `foo` is defined multiple times
38   --> $DIR/import-self.rs:12:5
39    |
40 LL | mod foo {
41    | ------- previous definition of the module `foo` here
42 ...
43 LL | use foo::self;
44    |     ^^^^^^^^^ `foo` reimported here
45    |
46    = note: `foo` must be defined only once in the type namespace of this module
47 help: you can use `as` to change the binding name of the import
48    |
49 LL | use foo as other_foo;
50    |     ^^^^^^^^^^^^^^^^
51
52 error[E0252]: the name `A` is defined multiple times
53   --> $DIR/import-self.rs:16:11
54    |
55 LL | use foo::A;
56    |     ------ previous import of the type `A` here
57 LL | use foo::{self as A};
58    |           ^^^^^^^^^ `A` reimported here
59    |
60    = note: `A` must be defined only once in the type namespace of this module
61 help: you can use `as` to change the binding name of the import
62    |
63 LL | use foo::{self as OtherA};
64    |           ^^^^^^^^^^^^^^
65
66 error: aborting due to 5 previous errors
67
68 Some errors have detailed explanations: E0252, E0255, E0429.
69 For more information about an error, try `rustc --explain E0252`.