Rollup merge of #128043 - safinaskar:primitive, r=workingjubilee · model-checking/verify-rust-std@ccba33c (original) (raw)

Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
12 12 //! const SOME_PROPERTY: bool = true;
13 13 //! }
14 14 //!
15 -//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
15 +//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }
16 16 //! ```
17 17 //!
18 18 //! Note that the `SOME_PROPERTY` associated constant would not compile, as its
@@ -25,11 +25,17 @@
25 25 //! pub struct bool;
26 26 //!
27 27 //! impl QueryId for bool {
28 -//! const SOME_PROPERTY: core::primitive::bool = true;
28 +//! const SOME_PROPERTY: ::core::primitive::bool = true;
29 29 //! }
30 30 //!
31 -//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
31 +//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }
32 32 //! ```
33 +//!
34 +//! We also used `::core` instead of `core`, because `core` can be
35 +//! shadowed, too. Paths, starting with `::`, are searched in
36 +//! the [extern prelude] since Edition 2018.
37 +//!
38 +//! [extern prelude]: https://doc.rust-lang.org/nightly/reference/names/preludes.html#extern-prelude
33 39
34 40 #[stable(feature = "core_primitive", since = "1.43.0")]
35 41 pub use bool;