From 1138866b1fe10127e910ce246d7c741bf51a6a04 Mon Sep 17 00:00:00 2001 From: tiehuis Date: Sun, 20 Mar 2016 16:02:31 +1300 Subject: [PATCH 1/2] 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. --- src/librustc_resolve/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 6313d7b7036..9d09e8d1eb1 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -3625,7 +3625,7 @@ fn show_candidates(session: &mut DiagnosticBuilder, if paths.len() == 1 { session.fileline_help( span, - &format!("you can to import it into scope: `use {};`.", + &format!("you can import it into scope: `use {};`.", &path_strings[0]), ); } else { From 63b66bfbcdec1208998dae83d26a3b4d808551d8 Mon Sep 17 00:00:00 2001 From: tiehuis Date: Sun, 20 Mar 2016 19:18:32 +1300 Subject: [PATCH 2/2] Update tests which reference E0421 --- src/test/compile-fail/issue-21221-2.rs | 2 +- src/test/compile-fail/issue-21221-3.rs | 2 +- src/test/compile-fail/issue-21221-4.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/compile-fail/issue-21221-2.rs b/src/test/compile-fail/issue-21221-2.rs index f031b62214d..cf5c6e8a3b4 100644 --- a/src/test/compile-fail/issue-21221-2.rs +++ b/src/test/compile-fail/issue-21221-2.rs @@ -27,5 +27,5 @@ pub mod baz { struct Foo; impl T for Foo { } //~^ ERROR trait `T` is not in scope -//~| HELP you can to import it into scope: `use foo::bar::T;`. +//~| HELP you can import it into scope: `use foo::bar::T;`. //~| HELP run `rustc --explain E0405` to see a detailed explanation diff --git a/src/test/compile-fail/issue-21221-3.rs b/src/test/compile-fail/issue-21221-3.rs index eee2c016451..a1a712d1421 100644 --- a/src/test/compile-fail/issue-21221-3.rs +++ b/src/test/compile-fail/issue-21221-3.rs @@ -24,7 +24,7 @@ struct Foo; // are hidden from the view. impl OuterTrait for Foo {} //~^ ERROR trait `OuterTrait` is not in scope -//~| HELP you can to import it into scope: `use issue_21221_3::outer::OuterTrait;`. +//~| HELP you can import it into scope: `use issue_21221_3::outer::OuterTrait;`. //~| HELP run `rustc --explain E0405` to see a detailed explanation fn main() { println!("Hello, world!"); diff --git a/src/test/compile-fail/issue-21221-4.rs b/src/test/compile-fail/issue-21221-4.rs index 6a76264dff7..1ef205bd8be 100644 --- a/src/test/compile-fail/issue-21221-4.rs +++ b/src/test/compile-fail/issue-21221-4.rs @@ -19,7 +19,7 @@ struct Foo; impl T for Foo {} //~^ ERROR trait `T` is not in scope -//~| HELP you can to import it into scope: `use issue_21221_4::T;`. +//~| HELP you can import it into scope: `use issue_21221_4::T;`. //~| HELP run `rustc --explain E0405` to see a detailed explanation fn main() {