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

Non-existant shadowed import succeeds incorrectly #13404

Closed
brson opened this issue Apr 8, 2014 · 0 comments
Closed

Non-existant shadowed import succeeds incorrectly #13404

brson opened this issue Apr 8, 2014 · 0 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Apr 8, 2014

This program should not compile because b::f does not exist, but it prints "a":

use a::f;
use b::f;

mod a { pub fn f() { println!("a"); } }
mod b { }

fn main() {
    f();
}
alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 10, 2014
Previously resolve was checking the "import resolution" for whether an import
had succeeded or not, but this was the same structure filled in by a previous
import if a name is shadowed. Instead, this alters resolve to consult the local
resolve state (as opposed to the shared one) to test whether an import succeeded
or not.

Closes rust-lang#13404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

1 participant