Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
raise ambiguity error on attribute macro that could be tool attribute
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
raise ambiguity error on attribute macro that could be tool attribute
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
Looks like the crater run is clean, so I guess we can do this (If the lang team agrees, of course) |
|
So the main drawback here is the same as with built-in attributes - with these rules you cannot add a new built-in tool module without a breakage (maybe theoretical). But if |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready
As far as new builtin tools go, the only idea I've seen is a |
|
By the way what's the process for merging something like this, where it's part of a rfc and technically a breaking change but has a clean crater run? Does any team need to be involved? |
View all comments
See #162597 (comment) for clean crater run; the errors are unrelated/spurious.
We need some sort of ambiguity error in other to implement the register tool rfc:
This PR implements the ambiguity error (not the "leading
::to disambiguate" part).This is a breaking change if:
#[(diagnostic|miri|rust_analyzer|clippy|rustfmt)::attr_macro](rather thanuse module_or_crate::attr_macro; #[attr_macro])register_tool, but that's unstable.See #158146 for context. This is a simpler version of that PR.
This does not implement unconditionally resolving these as tool attributes but does reserve the ability to do so. This would allow things like this to compile:
and see also #98291 for a case where it would be nice to assume e.g.
#[rustfmt::skip]is actually a tool attribute and thus inert.