mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Diagnose unimplemented built-in macros
This commit is contained in:
parent
06b301e2f8
commit
cb5454db86
6 changed files with 87 additions and 18 deletions
|
@ -36,8 +36,8 @@ use std::{iter, sync::Arc};
|
|||
use arrayvec::ArrayVec;
|
||||
use base_db::{CrateDisplayName, CrateId, Edition, FileId};
|
||||
use diagnostics::{
|
||||
InactiveCode, MacroError, UnresolvedExternCrate, UnresolvedImport, UnresolvedMacroCall,
|
||||
UnresolvedModule, UnresolvedProcMacro,
|
||||
InactiveCode, MacroError, UnimplementedBuiltinMacro, UnresolvedExternCrate, UnresolvedImport,
|
||||
UnresolvedMacroCall, UnresolvedModule, UnresolvedProcMacro,
|
||||
};
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
|
@ -565,6 +565,14 @@ impl Module {
|
|||
};
|
||||
sink.push(MacroError { file, node: ast, message: message.clone() });
|
||||
}
|
||||
|
||||
DefDiagnosticKind::UnimplementedBuiltinMacro { ast } => {
|
||||
let node = ast.to_node(db.upcast());
|
||||
// Must have a name, otherwise we wouldn't emit it.
|
||||
let name = node.name().expect("unimplemented builtin macro with no name");
|
||||
let ptr = SyntaxNodePtr::from(AstPtr::new(&name));
|
||||
sink.push(UnimplementedBuiltinMacro { file: ast.file_id, node: ptr });
|
||||
}
|
||||
}
|
||||
}
|
||||
for decl in self.declarations(db) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue