Skip to content

Commit b5e3e26

Browse files
ehusstraviscross
authored andcommitted
Add explicit rules for no_implicit_prelude
This is to follow the attribute template.
1 parent 0fe507d commit b5e3e26

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/names/preludes.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,21 @@ The *`no_implicit_prelude` [attribute]* may be applied at the crate level or on
169169
> }
170170
> ```
171171
172+
r[names.preludes.no_implicit_prelude.syntax]
173+
The `no_implicit_prelude` attribute uses the [MetaWord] syntax and thus does not take any inputs.
174+
175+
r[names.preludes.no_implicit_prelude.allowed-positions]
176+
The `no_implicit_prelude` attribute may only be applied to the crate level or a module.
177+
178+
> [!NOTE]
179+
> `rustc` currently warns in other positions, but this may be rejected in the future.
180+
181+
r[names.preludes.no_implicit_prelude.duplicates]
182+
Duplicate instances of the `no_implicit_prelude` attribute have no effect.
183+
184+
> [!NOTE]
185+
> `rustc` currently warns on subsequent duplicate `no_implicit_prelude` attributes.
186+
172187
r[names.preludes.no_implicit_prelude.lang]
173188
This attribute does not affect the [language prelude].
174189

0 commit comments

Comments
 (0)