about summary refs log tree commit diff
path: root/tests/ui/const-generics/lookup-method.rs
blob: 915935c94a55a087af09caed0eea16a450c67653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// https://github.com/rust-lang/rust/issues/124946

struct Builder<const A: bool, const B: bool>;

impl<const A: bool> Builder<A, false> {
    fn cast(self) -> Builder<A, true> {
        Builder
    }
}

impl Builder<true, true> {
    fn build(self) {}
}

fn main() {
    let b = Builder::<false, false>;
    b.cast().build();
    //~^ ERROR: no method named `build` found for struct `Builder<false, true>` in the current scope
}