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

1.1.0: glob imports break re-exporting a crate #26930

Closed
emidoots opened this issue Jul 10, 2015 · 1 comment · Fixed by #32850
Closed

1.1.0: glob imports break re-exporting a crate #26930

emidoots opened this issue Jul 10, 2015 · 1 comment · Fixed by #32850
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@emidoots
Copy link

cargo new mycrate

Add to Cargo.toml:

[dependencies]
num = "*"

Make empty x.rs file: touch mycrate/src/x.rs

Contents of mycrate/src/lib.rs:

extern crate num;
use num as num_export;
use self::x::*;
$ cargo build
   Compiling issue v0.1.0 (file:///home/stephen/Desktop/rust/issue)
src/lib.rs:2:5: 2:22 error: unresolved import (maybe you meant `num as num_export::*`?)
src/lib.rs:2 use num as num_export;
                 ^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `issue`.

To learn more, run the command again with --verbose.

Try removing the use self::x::*; line and everything will work just fine.

  • OS: Ubuntu 15.04 (beta)
  • rustc --version: rustc 1.1.0 (35ceea399 2015-06-19)
@alexcrichton alexcrichton added the A-resolve Area: Name/path resolution done by `rustc_resolve` specifically label Jul 10, 2015
@jseyfried
Copy link
Contributor

I tried duplicating this bug and had to add the line mod x; in mycrate/src/lib.rs so that self::x would resolve. With that addition, it compiles fine on stable and nightly, so I believe this should be closed.
cc @alexcrichton

@sfackler sfackler added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 23, 2016
jseyfried added a commit to jseyfried/rust that referenced this issue Apr 9, 2016
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 10, 2016
resolve: Add regression tests for fixed issues

This adds regression tests for fixed issues in resolve (closes rust-lang#22146, closes rust-lang#24883, closes rust-lang#26930).
r? @eddyb
bors added a commit that referenced this issue Apr 11, 2016
resolve: Add regression tests for fixed issues

This adds regression tests for fixed issues in resolve (closes #22146, closes #24883, closes #26930).
r? @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants