mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
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, rust-lang/rust#146965 and rust-lang/rust#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.)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//@ known-bug: #146965
|
||||
//@ compile-flags: --crate-type lib -C opt-level=3
|
||||
|
||||
fn conjure<T>() -> T {
|
||||
panic!()
|
||||
}
|
||||
|
||||
pub trait Ring {
|
||||
type Element;
|
||||
}
|
||||
impl<T> Ring for T {
|
||||
type Element = u16;
|
||||
}
|
||||
|
||||
// Removing the : Ring bound makes it not ICE
|
||||
fn map_coeff<T: Ring>(f: impl Fn(<T as Ring>::Element)) {
|
||||
let c = conjure::<<T as Ring>::Element>();
|
||||
f(c);
|
||||
}
|
||||
|
||||
// Adding a : Ring bound makes it not ICE
|
||||
fn gcd<T>() {
|
||||
map_coeff::<T>(|_: u16| {});
|
||||
}
|
||||
|
||||
// Removing the : Ring bound makes it not ICE
|
||||
pub fn bivariate_factorization<T: Ring>() {
|
||||
gcd::<T>();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//@ known-bug: #150263
|
||||
//@ compile-flags: --crate-type lib -C opt-level=3
|
||||
|
||||
pub trait Scope {
|
||||
type Timestamp;
|
||||
}
|
||||
impl<G> Scope for G {
|
||||
type Timestamp = ();
|
||||
}
|
||||
|
||||
pub fn create<G: Scope>() {
|
||||
enter::<G>();
|
||||
}
|
||||
|
||||
fn enter<G>() {
|
||||
unary::<G>(|_: <G as Scope>::Timestamp| {});
|
||||
}
|
||||
|
||||
fn unary<G: Scope>(constructor: impl FnOnce(G::Timestamp)) {
|
||||
constructor(None.unwrap());
|
||||
}
|
||||
Reference in New Issue
Block a user