Skip to content

Commit 9a4ebef

Browse files
author
Paolo Tranquilli
committed
Rust: fix compilation errors
1 parent 4ee6ee7 commit 9a4ebef

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

rust/extractor/src/rust_analyzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

rust/extractor/src/translate/base.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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
@@ -292,20 +292,20 @@ impl<'a> Translator<'a> {
292292
if let Some(value) = semantics
293293
.hir_file_for(expanded)
294294
.macro_file()
295-
.and_then(|macro_file| {
295+
.and_then(|macro_call_id| {
296296
semantics
297297
.db
298-
.parse_macro_expansion_error(macro_file.macro_call_id)
298+
.parse_macro_expansion_error(macro_call_id)
299299
})
300300
{
301301
if let Some(err) = &value.err {
302302
let error = err.render_to_string(semantics.db);
303-
304-
if err.span().anchor.file_id == semantics.hir_file_for(node.syntax()) {
303+
let hir_file_id = semantics.hir_file_for(node.syntax());
304+
if Some(err.span().anchor.file_id.file_id()) == hir_file_id.file_id().map(|f| f.file_id(semantics.db)) {
305305
let location = err.span().range
306306
+ semantics
307307
.db
308-
.ast_id_map(err.span().anchor.file_id.into())
308+
.ast_id_map(hir_file_id)
309309
.get_erased(err.span().anchor.ast_id)
310310
.text_range()
311311
.start();

0 commit comments

Comments
 (0)