Skip to content

Commit 97ecd04

Browse files
committed
Prelude clarifications
1 parent 7f14018 commit 97ecd04

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

text/0000-extension-trait-conventions.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ should follow a similar convention, putting together the type/trait
106106
name and the qualifications, together with the `Ext` suffix:
107107
`IteratorAddExt`.
108108

109+
### What about `Prelude`?
110+
111+
A [previous convention](https://github.com/rust-lang/rfcs/pull/344)
112+
used a `Prelude` suffix for extension traits that were also part of
113+
the `std` prelude; this new convention deprecates that one.
114+
109115
## Future proofing
110116

111117
In the future, the need for many of these extension traits may
@@ -132,8 +138,11 @@ especially painful when dealing with object safety. However, this is
132138
more to do with the language as it stands today than with the
133139
conventions in this RFC.
134140

135-
In the long run, one way to mitigate these problems would be to add a
136-
general "prelude" facility for external libraries that makes it
137-
possible to globally import a small set of names from the crate. Some
138-
early investigations of such a feature are already under way, but are
139-
outside the scope of this RFC.
141+
Libraries are already starting to export their own `prelude` module
142+
containing extension traits among other things, which by convention is
143+
glob imported.
144+
145+
In the long run, we should add a general "prelude" facility for
146+
external libraries that makes it possible to *globally* import a small
147+
set of names from the crate. Some early investigations of such a
148+
feature are already under way, but are outside the scope of this RFC.

0 commit comments

Comments
 (0)