Skip to content

Commit 0593e74

Browse files
Rollup merge of #153321 - fanninpm:test-crashes-add-high-priority, r=Kivooeo
Add high-priority ICEs to tests/crashes As of when I opened this PR, these two issues, #146965 and #150263, have been assigned as P-high. Per [the dev guide](https://rustc-dev-guide.rust-lang.org/tests/compiletest#crash-tests), I am adding these "untracked" crashes to the test suite, if that's okay with the relevant stakeholders. (I used to contribute to [glacier](https://github.com/rust-lang/glacier) about 5-6 years ago. Let me know if anything needs to change in these tests.)
2 parents 4c56778 + 13a5c24 commit 0593e74

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
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)