Weird error span for a mix of proc macro attributes #59013
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In Servo, we have a
proc_macro_attribute
nameddom_struct
which emits a bunch of other attributes on the types it adorns, among which aderive
attribute.Node
, being itself a DOM struct, obviously uses it.In the process of making use of
inert
, I added an#[inert::neutralize]
attribute onNode
but I put it after#[dom_struct]
, so rustc emitted an "macro attributes must be placed before#[derive]
" error as it should, so far so good.The problem is that the span itself of the error is completely wrong:
Most notably,
use crate::serviceworker_manager::ServiceWorkerManager;
is line 56 in that file.Things that should be kept in mind while trying to debug that is that I don't use
quote_spanned!
for this specific kind ofinert::neutralize
attribute, butdom_struct
itself does weird things because of #46489, but I really don't know if the wrong span is related to that bug.The text was updated successfully, but these errors were encountered: