about summary refs log tree commit diff
path: root/tests/ui/shadowed/primitive-type-shadowing.rs
blob: fdcb4246a82fc957a5cf5a795d10ac346a8b4d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Check that a primitive type can be shadowed by a user-defined type, and the primitive type
//! can still be referenced using its fully qualified path (e.g., `core::primitive::bool`).

//@ check-pass

mod bar {
    pub trait QueryId {
        const SOME_PROPERTY: bool;
    }
}

use bar::QueryId;

#[allow(non_camel_case_types)]
pub struct bool;

impl QueryId for bool {
    const SOME_PROPERTY: core::primitive::bool = true;
}

fn main() {}