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

Name resolution 2.0 does not support use declarations coming before the item they reference #2935

Open
CohenArthur opened this issue Mar 27, 2024 · 0 comments

Comments

@CohenArthur
Copy link
Member

use module::f;

pub mod module {
    pub fn f() {}
}

this should work, but running the compiler with -frust-name-resolution-2.0 produces this instead:

arthur@platypus ~/G/r/gccrs (master) [4]> build/gcc/crab1 test.rs -frust-name-resolution-2.0
test.rs:4:5: error: failed to resolve path segment ‘module’ [E0433]
    4 | use module::f;
      |     ^~~~~~
test.rs:4:5: error: failed to resolve path segment ‘module’ [E0433]
test.rs:4:5: error: failed to resolve path segment ‘module’ [E0433]
test.rs:4:13: error: unresolved import ‘module::f’ [E0433]
    4 | use module::f;
      |             ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant