mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
13 lines
271 B
Rust
13 lines
271 B
Rust
// reduced from rustc issue-69020-assoc-const-arith-overflow.rs
|
|
#![allow(clippy::out_of_bounds_indexing)]
|
|
|
|
pub fn main() {}
|
|
|
|
pub trait Foo {
|
|
const OOB: i32;
|
|
}
|
|
|
|
impl<T: Foo> Foo for Vec<T> {
|
|
const OOB: i32 = [1][1] + T::OOB;
|
|
//~^ ERROR: operation will panic
|
|
}
|