about summary refs log tree commit diff
path: root/tests/ui/repeat-expr/copy-check-when-count-inferred-later.rs
blob: b9d123cbefae6c140eee0b6565168011285d5189 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![feature(generic_arg_infer)]

// Test that we enforce repeat expr element types are `Copy` even
// when the repeat count is only inferred at a later point in type
// checking.

fn main() {
    let a = [String::new(); _];
    //~^ ERROR: the trait bound `String: Copy` is not satisfied
    let b: [_; 2] = a;
}