1 // revisions: nn ny yn yy
3 #![feature(const_trait_impl, associated_type_defaults, const_mut_refs)]
5 #[cfg_attr(any(yn, yy), const_trait)]
10 #[cfg_attr(any(ny, yy), const_trait)]
11 pub trait IndexMut where Self: Index {
12 const C: <Self as Index>::Output;
13 type Assoc = <Self as Index>::Output;
14 fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output;
17 impl Index for () { type Output = (); }
19 #[cfg(not(any(nn, yn)))]
20 impl const IndexMut for <() as Index>::Output {
21 const C: <Self as Index>::Output = ();
22 type Assoc = <Self as Index>::Output;
23 fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
24 where <Self as Index>::Output:,
29 impl IndexMut for <() as Index>::Output {
30 const C: <Self as Index>::Output = ();
31 type Assoc = <Self as Index>::Output;
32 fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
33 where <Self as Index>::Output:,
37 const C: <() as Index>::Output = ();