Skip to content

Commit

Permalink
Rollup merge of rust-lang#35558 - lukehinds:master, r=nikomatsakis
Browse files Browse the repository at this point in the history
Update error message for E0253 rust-lang#35512

Fixes rust-lang#35512. Part of rust-lang#35233.
  • Loading branch information
eddyb authored Aug 14, 2016
2 parents 9fb4fa8 + c974749 commit 9c347b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,9 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
}
Success(binding) if !binding.is_importable() => {
let msg = format!("`{}` is not directly importable", target);
span_err!(self.session, directive.span, E0253, "{}", &msg);
struct_span_err!(self.session, directive.span, E0253, "{}", &msg)
.span_label(directive.span, &format!("cannot be imported directly"))
.emit();
// Do not import this illegal binding. Import a dummy binding and pretend
// everything is fine
self.import_dummy_binding(module, directive);
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0253.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ mod foo {
}
}

use foo::MyTrait::do_something; //~ ERROR E0253
use foo::MyTrait::do_something;
//~^ ERROR E0253
//~|NOTE cannot be imported directly

fn main() {}

0 comments on commit 9c347b9

Please sign in to comment.