rust/tests/ui/const-generics/lookup-method.rs

20 lines
430 B
Rust
Raw Normal View History

// 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
}