mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Normalize field access types during borrowck
This commit is contained in:
parent
10c4c4afec
commit
4ff7e6e3e3
@ -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);
|
||||
|
25
src/test/ui/generic-associated-types/issue-93141.rs
Normal file
25
src/test/ui/generic-associated-types/issue-93141.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(generic_associated_types)]
|
||||
|
||||
pub trait Fooey: Sized {
|
||||
type Context<'c> where Self: 'c;
|
||||
}
|
||||
|
||||
pub struct Handle<E: Fooey>(Option<Box<dyn for<'c> Fn(&mut E::Context<'c>)>>);
|
||||
|
||||
fn tuple<T>() -> (Option<T>,) { (Option::None,) }
|
||||
|
||||
pub struct FooImpl {}
|
||||
impl Fooey for FooImpl {
|
||||
type Context<'c> = &'c ();
|
||||
}
|
||||
|
||||
impl FooImpl {
|
||||
pub fn fail1() -> Handle<Self> {
|
||||
let (tx,) = tuple();
|
||||
Handle(tx)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user