if it's rude
I would hope it generally isn't, but at the very least I can say that for me it isn't: people should feel free to ping me 
Regarding the question at hand, at first glance it looks like a compiler bug. Indeed, if we use
https://lib.rs/nougat
stable-Rust polyfill of generic_associated_types
, which thus happens to be more stable (for the cases it supports), we end up with a snippet which does compile:
-
- (I had to replace
'a : 'b
with &'a () : 'b
since nougat
does not currently support the former bounds in GAT position)
If I had to guess where the original issue stems from, I'd say that it's that 'a : 'b
bound which is not correctly propagated to the impl for<'b> FnMut…
signature: given the bound, we should be dealing with a for<'b where 'a : 'b>
kind of quantification, but it may not be the case?
Be it as it may, if we replace Self::FooRef<'b>
in the impl with the &'b Foo<'a>
actual type, we do get an ICE, so …

error: internal compiler error: failed region resolution while normalizing ParamEnv { caller_bounds: [Binder(ProjectionPredicate(ProjectionTy { substs: [impl for<'b> FnMut(&'b Foo<'a>), (<() as Bar<'a>>::FooRef<'b>,)], item_def_id: DefId(2:3527 ~ core[d628]::ops::function::FnOnce::Output) }, Ty(())), [Region(BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b))]), Binder(TraitPredicate(<impl for<'b> FnMut(&'b Foo<'a>) as std::ops::FnMut<(<() as Bar<'a>>::FooRef<'b>,)>>, polarity:Positive), [Region(BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b))]), Binder(TraitPredicate(<impl for<'b> FnMut(&'b Foo<'a>) as std::ops::FnOnce<(<() as Bar<'a>>::FooRef<'b>,)>>, polarity:Positive), [Region(BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b))]), Binder(TraitPredicate(<impl for<'b> FnMut(&'b Foo<'a>) as std::marker::Sized>, polarity:Positive), [])], reveal: UserFacing, constness: NotConst }: [ConcreteFailure(RelateRegionParamBound(src/lib.rs:26:5: 29:6 (#0)), RePlaceholder(Placeholder { universe: U1, name: BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b) }), ReEarlyBound(0, 'a)), ConcreteFailure(RelateRegionParamBound(src/lib.rs:26:5: 29:6 (#0)), RePlaceholder(Placeholder { universe: U2, name: BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b) }), ReEarlyBound(0, 'a)), ConcreteFailure(RelateRegionParamBound(src/lib.rs:26:5: 29:6 (#0)), RePlaceholder(Placeholder { universe: U3, name: BrNamed(DefId(0:12 ~ playground[e047]::Bar::uwu::{opaque#0}::'b), 'b) }), ReEarlyBound(0, 'a))]
--> src/lib.rs:26:5
|
26 | / fn uwu (
27 | | foo: Foo<'a>,
28 | | mut f: impl for<'b> FnMut(&'b Foo<'a>),
29 | | )
| |_____^
|
= note: delayed at compiler/rustc_trait_selection/src/traits/mod.rs:246:22
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1426:13
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.65.0-nightly (86c6ebee8 2022-08-16) running on x86_64-unknown-linux-gnu
EDIT
It turns out that replaceing 'a : 'b
with &'a () : 'b
and also replacing Self::FooRef<'b>
with its actual &'b Foo<'a>
meaning does make the snippet compile 