Skip to content

Commit

Permalink
fix: filter the DOS device path prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
bsun committed Feb 26, 2024
1 parent 5346002 commit ef505c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/hir-def/src/nameres/mod_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ impl DirPath {
fn join_attr(&self, mut attr: &str, relative_to_parent: bool) -> String {
let base = if relative_to_parent { self.parent().unwrap() } else { &self.0 };

if cfg!(windows) {
for dos_prefix in ["\\\\?\\", "\\\\.\\"] {
if attr.starts_with(dos_prefix) {
attr = &attr[dos_prefix.len()..];
break;
}
}
}
if attr.starts_with("./") {
attr = &attr["./".len()..];
}
Expand Down

0 comments on commit ef505c0

Please sign in to comment.