Skip to content

Commit aaeea7f

Browse files
committed
Alter wording for use foo::self help
1 parent d190e10 commit aaeea7f

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/librustc_resolve/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl<'a> Resolver<'a> {
316316
// use foo::bar::self as abc -> foo::bar as abc
317317
err.span_suggestion(
318318
span,
319-
"Remove `::self`..",
319+
"consider importing the module directly",
320320
"".to_string(),
321321
Applicability::MachineApplicable,
322322
);
@@ -328,7 +328,7 @@ impl<'a> Resolver<'a> {
328328
(span_with_rename.shrink_to_hi(), "}".to_string()),
329329
];
330330
err.multipart_suggestion(
331-
"..or add braces around `self`",
331+
"alternatively, use the multi-path `use` syntax to import `self`",
332332
braces,
333333
Applicability::MachineApplicable,
334334
);

src/test/ui/error-codes/E0429.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
44
LL | use std::fmt::self;
55
| ^^^^^^
66
|
7-
help: Remove `::self`..
7+
help: consider importing the module directly
88
|
99
LL | use std::fmt;
1010
| --
11-
help: ..or add braces around `self`
11+
help: alternatively, use the multi-path `use` syntax to import `self`
1212
|
1313
LL | use std::fmt::{self};
1414
| ^ ^

src/test/ui/issues/issue-45829/import-self.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ error[E0429]: `self` imports are only allowed within a { } list
1010
LL | use foo::self;
1111
| ^^^^^^
1212
|
13-
help: Remove `::self`..
13+
help: consider importing the module directly
1414
|
1515
LL | use foo;
1616
| --
17-
help: ..or add braces around `self`
17+
help: alternatively, use the multi-path `use` syntax to import `self`
1818
|
1919
LL | use foo::{self};
2020
| ^ ^

src/test/ui/use/use-mod/use-mod-4.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
44
LL | use foo::self;
55
| ^^^^^^
66
|
7-
help: Remove `::self`..
7+
help: consider importing the module directly
88
|
99
LL | use foo;
1010
| --
11-
help: ..or add braces around `self`
11+
help: alternatively, use the multi-path `use` syntax to import `self`
1212
|
1313
LL | use foo::{self};
1414
| ^ ^
@@ -19,11 +19,11 @@ error[E0429]: `self` imports are only allowed within a { } list
1919
LL | use std::mem::self;
2020
| ^^^^^^
2121
|
22-
help: Remove `::self`..
22+
help: consider importing the module directly
2323
|
2424
LL | use std::mem;
2525
| --
26-
help: ..or add braces around `self`
26+
help: alternatively, use the multi-path `use` syntax to import `self`
2727
|
2828
LL | use std::mem::{self};
2929
| ^ ^

src/test/ui/use/use-mod/use-mod-5.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
44
LL | use foo::bar::self;
55
| ^^^^^^
66
|
7-
help: Remove `::self`..
7+
help: consider importing the module directly
88
|
99
LL | use foo::bar;
1010
| --
11-
help: ..or add braces around `self`
11+
help: alternatively, use the multi-path `use` syntax to import `self`
1212
|
1313
LL | use foo::bar::{self};
1414
| ^ ^

src/test/ui/use/use-mod/use-mod-6.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
44
LL | use foo::bar::self as abc;
55
| ^^^^^^
66
|
7-
help: Remove `::self`..
7+
help: consider importing the module directly
88
|
99
LL | use foo::bar as abc;
1010
| --
11-
help: ..or add braces around `self`
11+
help: alternatively, use the multi-path `use` syntax to import `self`
1212
|
1313
LL | use foo::bar::{self as abc};
1414
| ^ ^

0 commit comments

Comments
 (0)