Normalize generic_ty before checking if bound is met
This commit is contained in:
parent
59216858a3
commit
3d464947d4
2 changed files with 20 additions and 0 deletions
|
@ -638,6 +638,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
let sub = var_data.normalize(self.tcx(), verify.region);
|
||||
|
||||
let verify_kind_ty = verify.kind.to_ty(self.tcx());
|
||||
let verify_kind_ty = var_data.normalize(self.tcx(), verify_kind_ty);
|
||||
if self.bound_is_met(&verify.bound, var_data, verify_kind_ty, sub) {
|
||||
continue;
|
||||
}
|
||||
|
|
19
src/test/ui/generic-associated-types/issue-81487.rs
Normal file
19
src/test/ui/generic-associated-types/issue-81487.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
// build-pass
|
||||
|
||||
#![feature(generic_associated_types)]
|
||||
|
||||
trait Trait {
|
||||
type Ref<'a>;
|
||||
}
|
||||
|
||||
impl Trait for () {
|
||||
type Ref<'a> = &'a i8;
|
||||
}
|
||||
|
||||
struct RefRef<'a, T: Trait>(&'a <T as Trait>::Ref<'a>);
|
||||
|
||||
fn wrap<'a, T: Trait>(reff: &'a <T as Trait>::Ref<'a>) -> RefRef<'a, T> {
|
||||
RefRef(reff)
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Reference in a new issue