add crashes tests for overlapping spans
This commit is contained in:
13
tests/crashes/146261.rs
Normal file
13
tests/crashes/146261.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// This is part of series of regression tests for some diagnostics ICEs encountered in the wild with
|
||||||
|
// suggestions having overlapping parts under https://github.com/rust-lang/rust/pull/146121.
|
||||||
|
|
||||||
|
//@ needs-rustc-debug-assertions
|
||||||
|
//@ known-bug: #146261
|
||||||
|
|
||||||
|
enum U {
|
||||||
|
B(),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
A(U::C)
|
||||||
|
}
|
||||||
15
tests/crashes/146706.rs
Normal file
15
tests/crashes/146706.rs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// This is part of series of regression tests for some diagnostics ICEs encountered in the wild with
|
||||||
|
// suggestions having overlapping parts under https://github.com/rust-lang/rust/pull/146121.
|
||||||
|
|
||||||
|
//@ needs-rustc-debug-assertions
|
||||||
|
//@ known-bug: #146706
|
||||||
|
|
||||||
|
type Alias<'a, T> = Foo<T>;
|
||||||
|
|
||||||
|
enum Foo<T> {
|
||||||
|
Bar { t: T },
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
Alias::Bar::<u32> { t: 0 };
|
||||||
|
}
|
||||||
14
tests/crashes/147973.rs
Normal file
14
tests/crashes/147973.rs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// This is part of series of regression tests for some diagnostics ICEs encountered in the wild with
|
||||||
|
// suggestions having overlapping parts under https://github.com/rust-lang/rust/pull/146121.
|
||||||
|
// This is one MCVE from the beta crater run regressions from issue 147973.
|
||||||
|
|
||||||
|
//@ needs-rustc-debug-assertions
|
||||||
|
//@ known-bug: #147973
|
||||||
|
|
||||||
|
//@ aux-build: overlapping_spans_helper.rs
|
||||||
|
extern crate overlapping_spans_helper;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let _name = Some(1);
|
||||||
|
overlapping_spans_helper::do_loop!(_name);
|
||||||
|
}
|
||||||
15
tests/crashes/auxiliary/overlapping_spans_helper.rs
Normal file
15
tests/crashes/auxiliary/overlapping_spans_helper.rs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// Auxiliary lib for the issue 147973 regression test with ICEs due to overlapping spans.
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! identity {
|
||||||
|
($x:ident) => {
|
||||||
|
$x
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! do_loop {
|
||||||
|
($x:ident) => {
|
||||||
|
for $crate::identity!($x) in $x {}
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user