2020-04-20 16:00:01 -05:00
|
|
|
// reduced from rustc issue-69020-assoc-const-arith-overflow.rs
|
2023-12-28 12:33:07 -06:00
|
|
|
#![allow(clippy::out_of_bounds_indexing)]
|
|
|
|
|
2020-04-20 16:00:01 -05:00
|
|
|
pub fn main() {}
|
|
|
|
|
|
|
|
pub trait Foo {
|
|
|
|
const OOB: i32;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: Foo> Foo for Vec<T> {
|
|
|
|
const OOB: i32 = [1][1] + T::OOB;
|
2023-07-02 07:35:19 -05:00
|
|
|
//~^ ERROR: operation will panic
|
2020-04-20 16:00:01 -05:00
|
|
|
}
|