Skip to content
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

chained import error message unhelpful #5582

Closed
metajack opened this issue Mar 27, 2013 · 6 comments
Closed

chained import error message unhelpful #5582

metajack opened this issue Mar 27, 2013 · 6 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@metajack
Copy link
Contributor

Currently doing:

use vectors = core::vec;
use vectors::raw;

fails with "error: unresolved import". It would be much better if this gave the real reason. Perhaps "error: chained imports are not allowed".

@catamorphism
Copy link
Contributor

The error is still not too helpful.

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

Visited for triage, still valid but low-priority.

@catamorphism
Copy link
Contributor

This compiles now. I'll add a test.

@catamorphism
Copy link
Contributor

As @huonw pointed out, I was wrong about the test -- actually, this is the test for this bug, which still yields an unhelpful error (one that doesn't mention chained imports):

mod foo {
    use vectors = std::vec;
    use vectors::raw;

    pub fn whatever() {
        use vectors::from_elem;
        let _ = from_elem(1, 5);
    }
}

fn main() {
    foo::whatever();
}

@catamorphism
Copy link
Contributor

With that said, I don't think this is a milestone blocker.

@emberian
Copy link
Member

emberian commented Apr 7, 2014

The original issue had nothing to do with chained imports, but the fact that it needed to be a use self::vectors::raw;, which works today. Closing.

@emberian emberian closed this as completed Apr 7, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue May 27, 2020
…variants, r=flip1995

New lint: `match_wildcard_for_single_variants`

changelog: Added a new lint match_wildcard_for_single_variants to warn on enum matches where a wildcard is used to match a single variant

Closes rust-lang#5556
calebcartwright pushed a commit to calebcartwright/rust that referenced this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants