mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Rollup merge of #128043 - safinaskar:primitive, r=workingjubilee
Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core" ``@rustbot`` label +A-docs
This commit is contained in:
commit
e56e886796
@ -12,7 +12,7 @@
|
|||||||
//! const SOME_PROPERTY: bool = true;
|
//! const SOME_PROPERTY: bool = true;
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
|
//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! Note that the `SOME_PROPERTY` associated constant would not compile, as its
|
//! Note that the `SOME_PROPERTY` associated constant would not compile, as its
|
||||||
@ -25,11 +25,17 @@
|
|||||||
//! pub struct bool;
|
//! pub struct bool;
|
||||||
//!
|
//!
|
||||||
//! impl QueryId for bool {
|
//! impl QueryId for bool {
|
||||||
//! const SOME_PROPERTY: core::primitive::bool = true;
|
//! const SOME_PROPERTY: ::core::primitive::bool = true;
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
|
//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }
|
||||||
//! ```
|
//! ```
|
||||||
|
//!
|
||||||
|
//! We also used `::core` instead of `core`, because `core` can be
|
||||||
|
//! shadowed, too. Paths, starting with `::`, are searched in
|
||||||
|
//! the [extern prelude] since Edition 2018.
|
||||||
|
//!
|
||||||
|
//! [extern prelude]: https://doc.rust-lang.org/nightly/reference/names/preludes.html#extern-prelude
|
||||||
|
|
||||||
#[stable(feature = "core_primitive", since = "1.43.0")]
|
#[stable(feature = "core_primitive", since = "1.43.0")]
|
||||||
pub use bool;
|
pub use bool;
|
||||||
|
Loading…
Reference in New Issue
Block a user