rust-clippy/tests/ui/crashes/ice-5497.rs

12 lines
228 B
Rust
Raw Normal View History

// reduced from rustc issue-69020-assoc-const-arith-overflow.rs
pub fn main() {}
pub trait Foo {
const OOB: i32;
}
impl<T: Foo> Foo for Vec<T> {
const OOB: i32 = [1][1] + T::OOB;
2023-04-20 15:19:36 +00:00
//~^ ERROR: operation will panic
}