Fix diagnostic and add a test for it

This commit is contained in:
Michael Goulet 2024-07-10 18:55:51 -04:00
parent df72e478b0
commit 12ae282987
3 changed files with 15 additions and 1 deletions

View File

@ -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,
}

View File

@ -0,0 +1,6 @@
#![feature(register_tool)]
#![register_tool(1)]
//~^ ERROR `register_tool` only accepts identifiers
fn main() {}

View 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