Skip to content

Add new ambiguity error for tools#158146

Draft
nbdd0121 wants to merge 1 commit into
rust-lang:mainfrom
nbdd0121:register_tool_resolve
Draft

Add new ambiguity error for tools#158146
nbdd0121 wants to merge 1 commit into
rust-lang:mainfrom
nbdd0121:register_tool_resolve

Conversation

@nbdd0121

Copy link
Copy Markdown
Member

Tracking issue: #66079

This implements the resolution changes of RFC 3808.

A new ambiguity error is added, and the tool attributes is no longer being affected by #[no_implicit_prelude] per the RFC. This is a breaking change.

To avoid widespread ambiguity errors, the attribute tools are only resolved if they are resolved as part of macro path (this could be further split to just attribute macros, but at which point we are kind of adding a new type of namespace?

Mark as draft until the implementation detail is agreed and a crater run is conducted.

r? @petrochenkov

This implements the ambiguity error and stop the tool attributes from
being affected by `#[no_implicit_prelude]` per the RFC.

To avoid widespread ambiguity errors, the attribute tools are only
resolved if they are resolved as part of macro path.

`registered_tool_decls` is adjusted to use plain symbol instead of
`IdentKey`; previously `ModuleGlobs` will adjust the ctxt to `ExpnId::root`
so was comparing ignoring the ctxt anyway.
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants