normalize the self-type that we extract from impl

This commit is contained in:
Niko Matsakis 2018-10-18 15:48:48 -04:00
parent f5cc7dba8a
commit 9a7bb0ef24
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,25 @@
// Regression test for #55183: check a case where the self type from
// the inherent impl requires normalization to be equal to the
// user-provided type.
//
// run-pass
#![feature(nll)]
trait Mirror {
type Me;
}
impl<T> Mirror for T {
type Me = T;
}
struct Foo<A, B>(A, B);
impl<A> Foo<A, <A as Mirror>::Me> {
fn m(b: A) { }
}
fn main() {
<Foo<&'static u32, &u32>>::m(&22);
}