-
Notifications
You must be signed in to change notification settings - Fork 1.7k
More resolution modules with attribute path #1528
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
Conversation
@@ -497,7 +497,7 @@ where | |||
|
|||
fn collect_module(&mut self, module: &raw::ModuleData) { | |||
match module { | |||
// inline module, just recurse | |||
// inline module, just recursive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think recurse is correct here and below.
separator(&file_path[current_dir.len()..]) | ||
} else { | ||
separator(file_path.as_str()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one can avoid the closure here:
if cond {
branch1
} else {
branch2
}.replace("\\", "/")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
#[test] | ||
fn module_resolution_module_decl_path_super() { | ||
let map = def_map_with_crate_graph( | ||
" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use an r#"
literal here to avoid escaping "
and \
everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -675,6 +676,17 @@ fn resolve_submodule( | |||
} | |||
} | |||
|
|||
fn normalize_attribute_path(file_path: &SmolStr) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could optimisitally try to avoid an allocation here, but, given this is already a cold path, this shouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
bors r+ |
1528: More resolution modules with attribute path r=matklad a=andreevlex #1211 Co-authored-by: Alexander Andreev <[email protected]>
Build succeeded |
#1211