Fix diagnostic and add a test for it
This commit is contained in:
parent
df72e478b0
commit
12ae282987
@ -1089,8 +1089,8 @@ pub(crate) struct ToolWasAlreadyRegistered {
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(resolve_tool_only_accepts_identifiers)]
|
||||
pub(crate) struct ToolOnlyAcceptsIdentifiers {
|
||||
#[label]
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub(crate) span: Span,
|
||||
pub(crate) tool: Symbol,
|
||||
}
|
||||
|
6
tests/ui/tool-attributes/invalid-tool.rs
Normal file
6
tests/ui/tool-attributes/invalid-tool.rs
Normal file
@ -0,0 +1,6 @@
|
||||
#![feature(register_tool)]
|
||||
|
||||
#![register_tool(1)]
|
||||
//~^ ERROR `register_tool` only accepts identifiers
|
||||
|
||||
fn main() {}
|
8
tests/ui/tool-attributes/invalid-tool.stderr
Normal file
8
tests/ui/tool-attributes/invalid-tool.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: `register_tool` only accepts identifiers
|
||||
--> $DIR/invalid-tool.rs:3:18
|
||||
|
|
||||
LL | #![register_tool(1)]
|
||||
| ^ not an identifier
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
Loading…
Reference in New Issue
Block a user