Skip to content

Add diagnostics for E0253 #27111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@ mod bar {
```
"##,

E0253: r##"
Attempt was made to import an unimportable value. This can happen when
trying to import a method from a trait. An example of this error:

```
mod foo {
pub trait MyTrait {
fn do_something();
}
}
use foo::MyTrait::do_something;
```

In general, it's not legal to directly import methods belonging to a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "in general"? is there an exception? this feels like the diagnostic is not sure why it's firing. Let's not ship slightly ambiguous language like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No exceptions as far as I'm aware. Since this is mid-commit I can always make another PR to fix it up.

trait or concrete type.
"##,

E0255: r##"
You can't import a value whose name is the same as another value defined in the
module.
Expand Down Expand Up @@ -262,7 +279,6 @@ http://doc.rust-lang.org/reference.html#use-declarations
register_diagnostics! {
E0153, // called no where
E0157, // called from no where
E0253, // not directly importable
E0254, // import conflicts with imported crate in this module
E0257,
E0258,
Expand Down