File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,9 @@ pub(crate) fn load(
152
152
& extern_source_roots,
153
153
proc_macro_client,
154
154
& mut |path : & Path | {
155
- let vfs_file = vfs. load ( path) ;
155
+ // Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs
156
+ let path = path. canonicalize ( ) . ok ( ) ?;
157
+ let vfs_file = vfs. load ( & path) ;
156
158
log:: debug!( "vfs file {:?} -> {:?}" , path, vfs_file) ;
157
159
vfs_file. map ( vfs_file_to_id)
158
160
} ,
Original file line number Diff line number Diff line change @@ -139,7 +139,9 @@ impl WorldState {
139
139
// Create crate graph from all the workspaces
140
140
let mut crate_graph = CrateGraph :: default ( ) ;
141
141
let mut load = |path : & std:: path:: Path | {
142
- let vfs_file = vfs. load ( path) ;
142
+ // Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs
143
+ let path = path. canonicalize ( ) . ok ( ) ?;
144
+ let vfs_file = vfs. load ( & path) ;
143
145
vfs_file. map ( |f| FileId ( f. 0 ) )
144
146
} ;
145
147
You can’t perform that action at this time.
0 commit comments