1 //! This module reexports the primitive types to allow usage that is not
2 //! possibly shadowed by other declared types.
4 //! This is normally only useful in macro generated code.
6 //! An example of this is when generating a new struct and an impl for it:
8 //! ```rust,compile_fail
11 //! impl QueryId for bool {
12 //! const SOME_PROPERTY: bool = true;
15 //! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
18 //! Note that the `SOME_PROPERTY` associated constant would not compile, as its
19 //! type `bool` refers to the struct, rather than to the primitive bool type.
21 //! A correct implementation could look like:
24 //! # #[allow(non_camel_case_types)]
27 //! impl QueryId for bool {
28 //! const SOME_PROPERTY: core::primitive::bool = true;
31 //! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; }
34 #[stable(feature = "core_primitive", since = "1.43.0")]
36 #[stable(feature = "core_primitive", since = "1.43.0")]
38 #[stable(feature = "core_primitive", since = "1.43.0")]
40 #[stable(feature = "core_primitive", since = "1.43.0")]
42 #[stable(feature = "core_primitive", since = "1.43.0")]
44 #[stable(feature = "core_primitive", since = "1.43.0")]
46 #[stable(feature = "core_primitive", since = "1.43.0")]
48 #[stable(feature = "core_primitive", since = "1.43.0")]
50 #[stable(feature = "core_primitive", since = "1.43.0")]
52 #[stable(feature = "core_primitive", since = "1.43.0")]
54 #[stable(feature = "core_primitive", since = "1.43.0")]
56 #[stable(feature = "core_primitive", since = "1.43.0")]
58 #[stable(feature = "core_primitive", since = "1.43.0")]
60 #[stable(feature = "core_primitive", since = "1.43.0")]
62 #[stable(feature = "core_primitive", since = "1.43.0")]
64 #[stable(feature = "core_primitive", since = "1.43.0")]
66 #[stable(feature = "core_primitive", since = "1.43.0")]