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> {
79
79
. ok_or ( "failed to determine rust edition" ) ?;
80
80
Ok ( (
81
81
semantics,
82
- EditionedFileId :: new ( semantics . db , editioned_file_id) ,
82
+ editioned_file_id,
83
83
input,
84
84
) )
85
85
}
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl<'a> Translator<'a> {
168
168
if let Some ( semantics) = self . semantics . as_ref ( ) {
169
169
let file_range = semantics. original_range ( node. syntax ( ) ) ;
170
170
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 {
172
172
Some ( file_range. range )
173
173
} else {
174
174
None
@@ -284,20 +284,20 @@ impl<'a> Translator<'a> {
284
284
if let Some ( value) = semantics
285
285
. hir_file_for ( expanded)
286
286
. macro_file ( )
287
- . and_then ( |macro_file | {
287
+ . and_then ( |macro_call_id | {
288
288
semantics
289
289
. db
290
- . parse_macro_expansion_error ( macro_file . macro_call_id )
290
+ . parse_macro_expansion_error ( macro_call_id)
291
291
} )
292
292
{
293
293
if let Some ( err) = & value. err {
294
294
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 ) ) {
297
297
let location = err. span ( ) . range
298
298
+ semantics
299
299
. db
300
- . ast_id_map ( err . span ( ) . anchor . file_id . into ( ) )
300
+ . ast_id_map ( hir_file_id )
301
301
. get_erased ( err. span ( ) . anchor . ast_id )
302
302
. text_range ( )
303
303
. start ( ) ;
You can’t perform that action at this time.
0 commit comments