Skip to content

Commit 34a3a36

Browse files
committed
liballoc RFC: avoid suggesting that preludes are associated to crates
1 parent eca6b28 commit 34a3a36

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

text/0000-liballoc.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ use alloc::rc::Rc;
9595
Like `std` and `core`, this dependency does not need to be declared in `Cargo.toml`
9696
since `alloc` is part of the standard library and distributed with Rust.
9797

98-
The `alloc` crate does not have a prelude (items that are implicitly in scope).
99-
So its items that are in the `std` prelude must be imported explicitly
100-
to be used in `no_std` crates:
98+
The prelude (set of items that are implicitly in scope) for `#![no_std]` crates
99+
does not assume the presence of the `alloc` crate, unlike the default prelude.
100+
So in such crates, items from `alloc` always need to be imported explicitly.
101+
For example:
101102

102103
```rust
103104
use alloc::vec::Vec;

0 commit comments

Comments
 (0)