Skip to content

Commit

Permalink
Alter wording for use foo::self help
Browse files Browse the repository at this point in the history
  • Loading branch information
mibac138 committed May 19, 2020
1 parent d190e10 commit aaeea7f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl<'a> Resolver<'a> {
// use foo::bar::self as abc -> foo::bar as abc
err.span_suggestion(
span,
"Remove `::self`..",
"consider importing the module directly",
"".to_string(),
Applicability::MachineApplicable,
);
Expand All @@ -328,7 +328,7 @@ impl<'a> Resolver<'a> {
(span_with_rename.shrink_to_hi(), "}".to_string()),
];
err.multipart_suggestion(
"..or add braces around `self`",
"alternatively, use the multi-path `use` syntax to import `self`",
braces,
Applicability::MachineApplicable,
);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/error-codes/E0429.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use std::fmt::self;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use std::fmt;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::fmt::{self};
| ^ ^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-45829/import-self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use foo::self;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use foo;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
| ^ ^
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/use/use-mod/use-mod-4.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use foo::self;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use foo;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
| ^ ^
Expand All @@ -19,11 +19,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use std::mem::self;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use std::mem;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::mem::{self};
| ^ ^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/use/use-mod/use-mod-5.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use foo::bar::self;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use foo::bar;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self};
| ^ ^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/use/use-mod/use-mod-6.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ error[E0429]: `self` imports are only allowed within a { } list
LL | use foo::bar::self as abc;
| ^^^^^^
|
help: Remove `::self`..
help: consider importing the module directly
|
LL | use foo::bar as abc;
| --
help: ..or add braces around `self`
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self as abc};
| ^ ^
Expand Down

0 comments on commit aaeea7f

Please sign in to comment.