const C: [u32; 5] = [0; 5];
-#[allow(const_err)]
+#[allow(panic, const_err)]
fn test() -> u32 {
C[10]
}
const C: &'static [u8; 5] = b"hello";
-#[allow(const_err)]
+#[allow(panic, const_err)]
fn test() -> u8 {
C[10]
}
const C: &'static [u8; 5] = b"hello";
-#[allow(const_err)]
+#[allow(panic, const_err)]
fn mir() -> u8 {
C[10]
}
// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
// compile-flags: -C debug-assertions
-#![allow(const_err)]
+#![allow(overflow)]
fn main() {
let _x = 200u8 + 200u8 + 200u8;
// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
// compile-flags: -C debug-assertions
-#![allow(const_err)]
+#![allow(overflow)]
fn main() {
let x = 200u8 * 4;
// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
// compile-flags: -C debug-assertions
-#![allow(const_err)]
+#![allow(overflow)]
fn main() {
let _x = -std::i8::MIN;
// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
// compile-flags: -C debug-assertions
-#![allow(const_err)]
+#![allow(overflow)]
fn main() {
let _x = 42u8 - (42u8 + 1);
-#![allow(const_err)]
+#![allow(panic, const_err)]
// error-pattern: attempt to divide by zero
-#![allow(const_err)]
+#![allow(overflow)]
// error-pattern: overflow
// compile-flags: -C overflow-checks=yes