mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
7221db2dc3
Fixes #5497
12 lines
227 B
Rust
12 lines
227 B
Rust
// 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;
|
|
//~^ ERROR operation will panic
|
|
}
|