Files
rust/tests/ui/repeat-expr/copy-check-when-count-inferred-later.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
280 B
Rust
Raw Normal View History

2025-05-26 16:35:36 +01:00
// 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;
}