Skip to content

Commit 173676e

Browse files
committed
Auto merge of #32367 - tiehuis:tiehuis-E0412-help, r=nagisa
Alter E0412 help message wording The initial wording does not make sense due to an extra 'to'. There are two potential candidates we can change this to: - 'you can import it into scope' - 'to import it into scope' In keeping the changes minimal, we choose the first, as this is more in line with the grammar of the extended candidates help message.
2 parents 015d3b7 + 63b66bf commit 173676e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3625,7 +3625,7 @@ fn show_candidates(session: &mut DiagnosticBuilder,
36253625
if paths.len() == 1 {
36263626
session.fileline_help(
36273627
span,
3628-
&format!("you can to import it into scope: `use {};`.",
3628+
&format!("you can import it into scope: `use {};`.",
36293629
&path_strings[0]),
36303630
);
36313631
} else {

src/test/compile-fail/issue-21221-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ pub mod baz {
2727
struct Foo;
2828
impl T for Foo { }
2929
//~^ ERROR trait `T` is not in scope
30-
//~| HELP you can to import it into scope: `use foo::bar::T;`.
30+
//~| HELP you can import it into scope: `use foo::bar::T;`.
3131
//~| HELP run `rustc --explain E0405` to see a detailed explanation

src/test/compile-fail/issue-21221-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct Foo;
2424
// are hidden from the view.
2525
impl OuterTrait for Foo {}
2626
//~^ ERROR trait `OuterTrait` is not in scope
27-
//~| HELP you can to import it into scope: `use issue_21221_3::outer::OuterTrait;`.
27+
//~| HELP you can import it into scope: `use issue_21221_3::outer::OuterTrait;`.
2828
//~| HELP run `rustc --explain E0405` to see a detailed explanation
2929
fn main() {
3030
println!("Hello, world!");

src/test/compile-fail/issue-21221-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Foo;
1919

2020
impl T for Foo {}
2121
//~^ ERROR trait `T` is not in scope
22-
//~| HELP you can to import it into scope: `use issue_21221_4::T;`.
22+
//~| HELP you can import it into scope: `use issue_21221_4::T;`.
2323
//~| HELP run `rustc --explain E0405` to see a detailed explanation
2424

2525
fn main() {

0 commit comments

Comments
 (0)