Update error message for E0253 #35512

Fixes #35512. Part of #35233.
This commit is contained in:
Luke Hinds 2016-08-09 22:31:57 +01:00
parent f0139140f6
commit 5c2c19aa89
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -14,6 +14,8 @@ mod foo {
}
}
use foo::MyTrait::do_something; //~ ERROR E0253
use foo::MyTrait::do_something;
//~^ ERROR E0253
//~|NOTE not directly importable
fn main() {}