2024-05-23 15:46:56 +00:00
|
|
|
//! Check that projections will constrain opaque types while looking for
|
|
|
|
//! matching impls.
|
|
|
|
|
|
|
|
//@ revisions: current next
|
|
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
|
|
|
//@[next] compile-flags: -Znext-solver
|
2024-06-11 06:49:12 +00:00
|
|
|
//@[next]check-pass
|
2024-05-23 15:46:56 +00:00
|
|
|
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
type Bar = impl Sized;
|
|
|
|
|
|
|
|
trait Trait<T> {
|
|
|
|
type Assoc: Default;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Trait<()> for Foo {
|
|
|
|
type Assoc = u32;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bop(_: Bar) {
|
|
|
|
let x = <Foo as Trait<Bar>>::Assoc::default();
|
2024-06-11 06:49:12 +00:00
|
|
|
//[current]~^ `Foo: Trait<Bar>` is not satisfied
|
2024-05-23 15:46:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|