blob: d70534feb072f26097336dd4a0eccaf5ff2cb7f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// compile-flags: -Ztrait-solver=next
// check-pass
// Verify that we can assemble inherent impl candidates on a possibly
// unnormalized self type.
trait Foo {
type Assoc;
}
impl Foo for i32 {
type Assoc = Bar;
}
struct Bar;
impl Bar {
fn method(&self) {}
}
fn build<T: Foo>(_: T) -> T::Assoc {
todo!()
}
fn main() {
build(1i32).method();
}
|