2025-07-13 16:56:31 -04:00
|
|
|
// https://github.com/rust-lang/rust/issues/76191
|
2020-09-01 15:53:04 -07:00
|
|
|
// Regression test for diagnostic issue #76191
|
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
|
|
|
|
|
use std::ops::RangeInclusive;
|
2020-09-15 09:56:17 -07:00
|
|
|
|
2020-09-01 15:53:04 -07:00
|
|
|
const RANGE: RangeInclusive<i32> = 0..=255;
|
|
|
|
|
|
2020-09-15 09:56:17 -07:00
|
|
|
const RANGE2: RangeInclusive<i32> = panic!();
|
2025-05-28 10:29:08 +00:00
|
|
|
//~^ ERROR evaluation panicked: explicit panic
|
2020-09-15 09:56:17 -07:00
|
|
|
|
2020-09-01 15:53:04 -07:00
|
|
|
fn main() {
|
|
|
|
|
let n: i32 = 1;
|
|
|
|
|
match n {
|
|
|
|
|
RANGE => {}
|
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-15 09:56:17 -07:00
|
|
|
RANGE2 => {}
|
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-01 15:53:04 -07:00
|
|
|
_ => {}
|
|
|
|
|
}
|
|
|
|
|
}
|