Module Resolution Fixes - #7043
Conversation
…ation Fixes rust-lang/rustfmt 7038
|
Just to make sure, does this construct paths with the cartesian product? i.e. #[cfg_attr(unix, path = "a")]
#[cfg_attr(not(unix), path = "b")]
mod outer1 {
#[cfg_attr(unix, path = "c")]
#[cfg_attr(not(unix), path = "d")]
mod outer2 {
#[cfg_attr(unix, path = "e.rs")]
#[cfg_attr(not(unix), path = "f.rs")]
mod inner;
}
}should format each of |
@purplesyringa yes, as currently implemented this would construct paths for each of these:
Having written that all out it feels like only |
| #[derive(Clone)] | ||
| enum SubModKind<'a, 'ast> { | ||
| /// `mod foo;` | ||
| /// |
There was a problem hiding this comment.
The comments make this enum much clearer!
We should probably add a test case for this before merging. |
Fixes #7038
This mostly addresses #7038, but I've added a mod resolution test to more exhaustively check resolution with path attributes as mentioned in the reference, and I've updated the doc comments on
SubModKind.