Skip to content

Commit

Permalink
Auto merge of #32367 - tiehuis:tiehuis-E0412-help, r=nagisa
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Mar 20, 2016
2 parents 015d3b7 + 63b66bf commit 173676e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-21221-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-21221-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-21221-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 173676e

Please sign in to comment.