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

Original file line numberDiff line numberDiff line change

@@ -12,7 +12,7 @@

1212

//! const SOME_PROPERTY: bool = true;

1313

//! }

1414

//!

15-

//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }

15+

//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }

1616

//! ```

1717

//!

1818

//! Note that the `SOME_PROPERTY` associated constant would not compile, as its

@@ -25,11 +25,17 @@

2525

//! pub struct bool;

2626

//!

2727

//! impl QueryId for bool {

28-

//! const SOME_PROPERTY: core::primitive::bool = true;

28+

//! const SOME_PROPERTY: ::core::primitive::bool = true;

2929

//! }

3030

//!

31-

//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }

31+

//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }

3232

//! ```

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

3339
3440

#[stable(feature = "core_primitive", since = "1.43.0")]

3541

pub use bool;