1 // We should not see the unused_attributes lint fire for
2 // rustc_on_unimplemented, but with this bug we are seeing it fire (on
3 // subsequent runs) if incremental compilation is enabled.
5 // revisions: cfail1 cfail2
6 // build-pass (FIXME(62277): could be check-pass?)
8 #![feature(rustc_attrs)]
9 #![deny(unused_attributes)]
11 #[rustc_on_unimplemented = "invalid"]
12 trait Index<Idx: ?Sized> {
14 fn index(&self, index: Idx) -> &Self::Output;
17 #[rustc_on_unimplemented = "a usize is required to index into a slice"]
18 impl Index<usize> for [i32] {
20 fn index(&self, index: usize) -> &i32 {
26 Index::<usize>::index(&[1, 2, 3] as &[i32], 2);