about summary refs log tree commit diff
path: root/tests/ui/consts/issue-94675.rs
blob: f2ddc928d122e11271587748b931cec08b760c4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ ignore-backends: gcc

#![feature(const_trait_impl)]

struct Foo<'a> {
    bar: &'a mut Vec<usize>,
}

impl<'a> Foo<'a> {
    const fn spam(&mut self, baz: &mut Vec<u32>) {
        self.bar[0] = baz.len();
        //~^ ERROR: `Vec<usize>: [const] Index<_>` is not satisfied
        //~| ERROR: `Vec<usize>: [const] Index<usize>` is not satisfied
        //~| ERROR: `Vec<usize>: [const] IndexMut<usize>` is not satisfied
    }
}

fn main() {}