Skip to content

Commit b724f63

Browse files
committed
Auto merge of #153321 - fanninpm:test-crashes-add-high-priority, r=<try>
Add high-priority ICEs to tests/crashes try-job: x86_64-gnu-nopt try-job: x86_64-gnu-aux
2 parents 80282b1 + 4cb397a commit b724f63

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

tests/crashes/146965.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//@ known-bug: #146965
2+
//@ compile-flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C strip=debuginfo
3+
4+
fn conjure<T>() -> T {
5+
panic!()
6+
}
7+
8+
pub trait Ring {
9+
type Element;
10+
}
11+
impl<T> Ring for T {
12+
type Element = u16;
13+
}
14+
15+
// Removing the : Ring bound makes it not ICE
16+
fn map_coeff<T: Ring>(f: impl Fn(<T as Ring>::Element)) {
17+
let c = conjure::<<T as Ring>::Element>();
18+
f(c);
19+
}
20+
21+
// Adding a : Ring bound makes it not ICE
22+
fn gcd<T>() {
23+
map_coeff::<T>(|_: u16| {});
24+
}
25+
26+
// Removing the : Ring bound makes it not ICE
27+
pub fn bivariate_factorization<T: Ring>() {
28+
gcd::<T>();
29+
}

tests/crashes/150263.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ known-bug: #150263
2+
//@ compile-flags: --crate-type lib -C opt-level=3
3+
4+
pub trait Scope {
5+
type Timestamp;
6+
}
7+
impl<G> Scope for G {
8+
type Timestamp = ();
9+
}
10+
11+
pub fn create<G: Scope>() {
12+
enter::<G>();
13+
}
14+
15+
fn enter<G>() {
16+
unary::<G>(|_: <G as Scope>::Timestamp| {});
17+
}
18+
19+
fn unary<G: Scope>(constructor: impl FnOnce(G::Timestamp)) {
20+
constructor(None.unwrap());
21+
}

0 commit comments

Comments
 (0)