Skip to content

Commit 0918563

Browse files
committed
Add explicit rules for no_implicit_prelude
This is to follow the attribute template.
1 parent 56039c1 commit 0918563

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
@@ -158,6 +158,21 @@ The *`no_implicit_prelude` [attribute]* may be applied at the crate level or on
158158
> }
159159
> ```
160160
161+
r[names.preludes.no_implicit_prelude.syntax]
162+
The `no_implicit_prelude` attribute uses the [MetaWord] syntax and thus does not take any inputs.
163+
164+
r[names.preludes.no_implicit_prelude.allowed-positions]
165+
The `no_implicit_prelude` attribute may only be applied to the crate level or a module.
166+
167+
> [!NOTE]
168+
> `rustc` currently warns in other positions, but this may be rejected in the future.
169+
170+
r[names.preludes.no_implicit_prelude.duplicates]
171+
Duplicate instances of the `no_implicit_prelude` attribute have no effect.
172+
173+
> [!NOTE]
174+
> `rustc` currently warns on subsequent duplicate `no_implicit_prelude` attributes.
175+
161176
r[names.preludes.no_implicit_prelude.lang]
162177
This attribute does not affect the [language prelude].
163178

0 commit comments

Comments
 (0)