Skip to content

Importing private reexports does not work #32303

New issue

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

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

Already on GitHub? # to your account

Closed
emberian opened this issue Mar 17, 2016 · 3 comments · Fixed by #37127
Closed

Importing private reexports does not work #32303

emberian opened this issue Mar 17, 2016 · 3 comments · Fixed by #37127
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@emberian
Copy link
Member

Testcase:

#![crate_type = "lib"]

use std::vec::Vec as Vec;

mod foo {
    use Vec;
}

This should seemingly go through with no issue, but instead:

rustc output:

foo.rs:6:9: 6:12 error: unresolved import `Vec`. There is no `Vec` in `???`. Did you mean to use `Vec`? [E0432]
foo.rs:6     use Vec;
                 ^~~
foo.rs:6:9: 6:12 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to previous error
@emberian emberian changed the title Importing reexports does not work Importing private reexports does not work Mar 17, 2016
@emberian
Copy link
Member Author

Same error:

#![crate_type = "lib"]

use std::vec::Vec;

mod foo {
    use Vec;
}
#![crate_type = "lib"]

use std::vec::Vec as Foo;

mod foo {
    use Foo;
}

@emberian emberian added the A-resolve Area: Name/path resolution done by `rustc_resolve` specifically label Mar 17, 2016
@emberian
Copy link
Member Author

If we don't want to support this feature (which is useful for no_std crates to switch between std modules and non-std modules), the error message should be more specific.

@petrochenkov
Copy link
Contributor

This is "by design" currently, but it's being fixed in #32213 (which probably needs an RFC before merging).

bors added a commit that referenced this issue Nov 21, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants