-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Description
The following code compiles correctly:
struct Foo;
mod inner {
use super::Foo;
}
However, when wrapped in a function:
fn outer() {
struct Foo;
mod inner {
use super::Foo;
}
}
it gives the following error:
error[E0432]: unresolved import `super::Foo`
--> src/lib.rs:4:13
|
4 | use super::Foo;
| ^^^^^^^^^^ no `Foo` in the root
error: aborting due to previous error
This can make it difficult to write attribute macros which expand to module declarations. Ideally, such macros would be useeable no matter where the annotated type is declared. However, this issue prevents such macros from being used on a type declared within a function.
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team