Skip to content

Commit

Permalink
Docs for core::primitive: mention that "core" can be shadowed, too, s…
Browse files Browse the repository at this point in the history
…o we should write "::core"
  • Loading branch information
Askar Safin committed Jul 21, 2024
1 parent 894f7a4 commit e32b59c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! 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
Expand All @@ -25,10 +25,10 @@
//! pub struct bool;
//!
//! impl QueryId for bool {
//! const SOME_PROPERTY: core::primitive::bool = true;
//! const SOME_PROPERTY: ::core::primitive::bool = true; // We also used `::core` instead of `core`, because `core` can be shadowed, too
//! }
//!
//! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
//! # trait QueryId { const SOME_PROPERTY: ::core::primitive::bool; }
//! ```

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

0 comments on commit e32b59c

Please sign in to comment.