]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-41742.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-41742.rs
1 use std::ops::{Index, IndexMut};
2
3 struct S;
4 struct H;
5
6 impl S {
7     fn f(&mut self) {}
8 }
9
10 impl Index<u32> for H {
11     type Output = S;
12     fn index(&self, index: u32) -> &S {
13         unimplemented!()
14     }
15 }
16
17 impl IndexMut<u32> for H {
18     fn index_mut(&mut self, index: u32) -> &mut S {
19         unimplemented!()
20     }
21 }
22
23 fn main() {
24     H["?"].f(); //~ ERROR mismatched types
25 }