diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index b6f5f4998a6..73103643e3e 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -758,6 +758,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { }, ProjectionElem::Field(field, fty) => { let fty = self.sanitize_type(place, fty); + let fty = self.cx.normalize(fty, location); match self.field_ty(place, base, field, location) { Ok(ty) => { let ty = self.cx.normalize(ty, location); diff --git a/src/test/ui/generic-associated-types/issue-93141.rs b/src/test/ui/generic-associated-types/issue-93141.rs new file mode 100644 index 00000000000..39ca77d13db --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-93141.rs @@ -0,0 +1,25 @@ +// check-pass + +#![feature(generic_associated_types)] + +pub trait Fooey: Sized { + type Context<'c> where Self: 'c; +} + +pub struct Handle(Option Fn(&mut E::Context<'c>)>>); + +fn tuple() -> (Option,) { (Option::None,) } + +pub struct FooImpl {} +impl Fooey for FooImpl { + type Context<'c> = &'c (); +} + +impl FooImpl { + pub fn fail1() -> Handle { + let (tx,) = tuple(); + Handle(tx) + } +} + +fn main() {}