Repository navigation
Conversation
DanielEScherzer
suggested changes
Nov 2, 2026
|
|
||
| r[names.preludes.no_implicit_prelude.intro] | ||
| The *`no_implicit_prelude` [attribute]* is used to prevent implicit preludes from being brought into scope. | ||
| The `no_implicit_prelude` attribute prevents the [standard library prelude], [extern prelude], and the [`macro_use` prelude] from being brought into scope for a crate or a module and its descendants. |
Contributor
There was a problem hiding this comment.
I would suggest leaving the .intro rule unchanged, and just moving the tool prelude mention from .excluded-preludes to the (now renamed) .unaffected
Member
Author
There was a problem hiding this comment.
I found it quite jarring to have basically the same information in two places with one being a watered down version of the other. It's still "intro length" so I thought it best to just say it once.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 3, 2026
…r, r=petrochenkov Make `no_implicit_prelude` not suppress tool attributes Implements part of the `register_tool` rfc, [RFC 3808](https://rust-lang.github.io/rfcs/3808-register-tool.html): > Today, #![no_implicit_prelude] suppresses the tool attribute prelude but does not suppress the lint prelude (e.g., #[allow(clippy::foo)] continues to work). Under this RFC, neither prelude is suppressed by #![no_implicit_prelude]. This is technically a breaking change since it can produce new ambiguity errors in stable code. (The breaking change is already taken care of in rust-lang#162597, the ambiguity error is raised regardless of whether the `no_implicit_prelude` attribute is used) Currently, the following code errors. After this PR, it will start compiling. ```rust #![no_implicit_prelude] #![feature(register_tool)] #![register_tool(my_tool)] #[my_tool::attr] // ERROR cannot find module or crate `my_tool` in this scope #[rustfmt::skip] // ERROR cannot find module or crate `rustfmt` in this scope struct X; ``` Reference PR: rust-lang/reference#2404 r? petrochenkov
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 3, 2026
…r, r=petrochenkov Make `no_implicit_prelude` not suppress tool attributes Implements part of the `register_tool` rfc, [RFC 3808](https://rust-lang.github.io/rfcs/3808-register-tool.html): > Today, #![no_implicit_prelude] suppresses the tool attribute prelude but does not suppress the lint prelude (e.g., #[allow(clippy::foo)] continues to work). Under this RFC, neither prelude is suppressed by #![no_implicit_prelude]. This is technically a breaking change since it can produce new ambiguity errors in stable code. (The breaking change is already taken care of in rust-lang#162597, the ambiguity error is raised regardless of whether the `no_implicit_prelude` attribute is used) Currently, the following code errors. After this PR, it will start compiling. ```rust #![no_implicit_prelude] #![feature(register_tool)] #![register_tool(my_tool)] #[my_tool::attr] // ERROR cannot find module or crate `my_tool` in this scope #[rustfmt::skip] // ERROR cannot find module or crate `rustfmt` in this scope struct X; ``` Reference PR: rust-lang/reference#2404 r? petrochenkov
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 3, 2026
…r, r=petrochenkov Make `no_implicit_prelude` not suppress tool attributes Implements part of the `register_tool` rfc, [RFC 3808](https://rust-lang.github.io/rfcs/3808-register-tool.html): > Today, #![no_implicit_prelude] suppresses the tool attribute prelude but does not suppress the lint prelude (e.g., #[allow(clippy::foo)] continues to work). Under this RFC, neither prelude is suppressed by #![no_implicit_prelude]. This is technically a breaking change since it can produce new ambiguity errors in stable code. (The breaking change is already taken care of in rust-lang#162597, the ambiguity error is raised regardless of whether the `no_implicit_prelude` attribute is used) Currently, the following code errors. After this PR, it will start compiling. ```rust #![no_implicit_prelude] #![feature(register_tool)] #![register_tool(my_tool)] #[my_tool::attr] // ERROR cannot find module or crate `my_tool` in this scope #[rustfmt::skip] // ERROR cannot find module or crate `rustfmt` in this scope struct X; ``` Reference PR: rust-lang/reference#2404 r? petrochenkov
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 3, 2026
…r, r=petrochenkov Make `no_implicit_prelude` not suppress tool attributes Implements part of the `register_tool` rfc, [RFC 3808](https://rust-lang.github.io/rfcs/3808-register-tool.html): > Today, #![no_implicit_prelude] suppresses the tool attribute prelude but does not suppress the lint prelude (e.g., #[allow(clippy::foo)] continues to work). Under this RFC, neither prelude is suppressed by #![no_implicit_prelude]. This is technically a breaking change since it can produce new ambiguity errors in stable code. (The breaking change is already taken care of in rust-lang#162597, the ambiguity error is raised regardless of whether the `no_implicit_prelude` attribute is used) Currently, the following code errors. After this PR, it will start compiling. ```rust #![no_implicit_prelude] #![feature(register_tool)] #![register_tool(my_tool)] #[my_tool::attr] // ERROR cannot find module or crate `my_tool` in this scope #[rustfmt::skip] // ERROR cannot find module or crate `rustfmt` in this scope struct X; ``` Reference PR: rust-lang/reference#2404 r? petrochenkov
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Nov 4, 2026
Rollup merge of #165377 - mejrs:no_implicit_prelude_tool_attr, r=petrochenkov Make `no_implicit_prelude` not suppress tool attributes Implements part of the `register_tool` rfc, [RFC 3808](https://rust-lang.github.io/rfcs/3808-register-tool.html): > Today, #![no_implicit_prelude] suppresses the tool attribute prelude but does not suppress the lint prelude (e.g., #[allow(clippy::foo)] continues to work). Under this RFC, neither prelude is suppressed by #![no_implicit_prelude]. This is technically a breaking change since it can produce new ambiguity errors in stable code. (The breaking change is already taken care of in #162597, the ambiguity error is raised regardless of whether the `no_implicit_prelude` attribute is used) Currently, the following code errors. After this PR, it will start compiling. ```rust #![no_implicit_prelude] #![feature(register_tool)] #![register_tool(my_tool)] #[my_tool::attr] // ERROR cannot find module or crate `my_tool` in this scope #[rustfmt::skip] // ERROR cannot find module or crate `rustfmt` in this scope struct X; ``` Reference PR: rust-lang/reference#2404 r? petrochenkov
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked on rust-lang/rust#165377