File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ impl<'a> RustAnalyzer<'a> {
7979 . ok_or ( "failed to determine rust edition" ) ?;
8080 Ok ( (
8181 semantics,
82- EditionedFileId :: new ( semantics . db , editioned_file_id) ,
82+ editioned_file_id,
8383 input,
8484 ) )
8585 }
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl<'a> Translator<'a> {
168168 if let Some ( semantics) = self . semantics . as_ref ( ) {
169169 let file_range = semantics. original_range ( node. syntax ( ) ) ;
170170 let file_id = self . file_id ?;
171- if file_id. file_id ( semantics . db ) == file_range. file_id {
171+ if file_id == file_range. file_id {
172172 Some ( file_range. range )
173173 } else {
174174 None
@@ -284,20 +284,20 @@ impl<'a> Translator<'a> {
284284 if let Some ( value) = semantics
285285 . hir_file_for ( expanded)
286286 . macro_file ( )
287- . and_then ( |macro_file | {
287+ . and_then ( |macro_call_id | {
288288 semantics
289289 . db
290- . parse_macro_expansion_error ( macro_file . macro_call_id )
290+ . parse_macro_expansion_error ( macro_call_id)
291291 } )
292292 {
293293 if let Some ( err) = & value. err {
294294 let error = err. render_to_string ( semantics. db ) ;
295-
296- if err. span ( ) . anchor . file_id == semantics . hir_file_for ( node . syntax ( ) ) {
295+ let hir_file_id = semantics . hir_file_for ( node . syntax ( ) ) ;
296+ if Some ( err. span ( ) . anchor . file_id . file_id ( ) ) == hir_file_id . file_id ( ) . map ( |f| f . file_id ( semantics . db ) ) {
297297 let location = err. span ( ) . range
298298 + semantics
299299 . db
300- . ast_id_map ( err . span ( ) . anchor . file_id . into ( ) )
300+ . ast_id_map ( hir_file_id )
301301 . get_erased ( err. span ( ) . anchor . ast_id )
302302 . text_range ( )
303303 . start ( ) ;
You can’t perform that action at this time.
0 commit comments