Files
rust/tests/ui/traits/winnowing/global-non-global-env-2.rs

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

24 lines
546 B
Rust
Raw Normal View History

2024-11-29 18:43:55 +01:00
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
2024-11-14 18:50:32 +01:00
// A regression test for an edge case of candidate selection
// in the old trait solver, see #132325 for more details. Unlike
// the first test, this one has two impl candidates.
trait Trait<T> {}
impl Trait<u32> for () {}
impl Trait<u64> for () {}
fn impls_trait<T: Trait<U>, U>(_: T) -> U { todo!() }
fn foo<T>() -> u32
where
(): Trait<u32>,
(): Trait<T>,
{
impls_trait(())
2024-11-14 18:50:32 +01:00
}
fn main() {}