2 #![allow(unused_variables)]
3 // Test that overloaded index expressions with DST result types
11 impl Index<usize> for S {
14 fn index<'a>(&'a self, _: usize) -> &'a str {
21 impl Index<usize> for T {
22 type Output = dyn Debug + 'static;
24 fn index<'a>(&'a self, idx: usize) -> &'a (dyn Debug + 'static) {
26 &X as &(dyn Debug + 'static)
31 assert_eq!(&S[0], "hello");
33 // let x = &x as &Debug;