One can use unsized_locals for this… Here’s just an example to make it compile:
#![feature(unsized_locals)]
use core::ops::Index;
use core::fmt::Debug;
type A<'a> = &'a dyn Index<dyn Debug, Output = u8>;
fn main() {
let x: A<'_> = panic!();
let y: dyn Debug = *(&0 as &dyn Debug);
x.index(y);
}
If that is useful remains to be seen. However, it is a breaking change to enforce Idx: Sized.