rust/tests/ui/traits/next-solver/temporary-ambiguity.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
366 B
Rust
Raw Normal View History

2023-12-14 06:11:28 -06:00
// compile-flags: -Znext-solver
// check-pass
// Checks that we don't explode when we assemble >1 candidate for a goal.
struct Wrapper<T>(T);
trait Foo {}
impl Foo for Wrapper<i32> {}
impl Foo for Wrapper<()> {}
fn needs_foo(_: impl Foo) {}
fn main() {
let mut x = Default::default();
let w = Wrapper(x);
needs_foo(w);
x = 1;
let _ = x;
}