Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 12e8cda

Browse files
committed
Auto merge of rust-lang#124248 - matthiaskrgr:rollup-tt6fq7h, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - rust-lang#124236 (crashes: add a couple more ICE tests) - rust-lang#124240 (add a couple tests for fixed ICEs.) - rust-lang#124246 (Add comma at one place in `abs()` documentation) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3288583 + f840afb commit 12e8cda

13 files changed

+187
-1
lines changed

library/core/src/num/int_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,7 @@ macro_rules! int_impl {
31993199
/// that code in debug mode will trigger a panic on this case and
32003200
/// optimized code will return
32013201
#[doc = concat!("`", stringify!($SelfT), "::MIN`")]
3202-
/// without a panic. If you do not want this behavior consider
3202+
/// without a panic. If you do not want this behavior, consider
32033203
/// using [`unsigned_abs`](Self::unsigned_abs) instead.
32043204
///
32053205
/// # Examples

tests/crashes/123664.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #123664
2+
#![feature(generic_const_exprs, effects)]
3+
const fn with_positive<F: ~const Fn()>() {}
4+
pub fn main() {}

tests/crashes/123955.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #123955
2+
//@ compile-flags: -Clto -Zvirtual-function-elimination
3+
//@ only-x86_64
4+
pub fn main() {
5+
_ = Box::new(()) as Box<dyn Send>;
6+
}

tests/crashes/124092.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #124092
2+
//@ compile-flags: -Zvirtual-function-elimination=true -Clto=true
3+
//@ only-x86_64
4+
const X: for<'b> fn(&'b ()) = |&()| ();
5+
fn main() {
6+
let dyn_debug = Box::new(X) as Box<fn(&'static ())> as Box<dyn Send>;
7+
}

tests/crashes/124182.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #124182
2+
struct LazyLock<T> {
3+
data: (Copy, fn() -> T),
4+
}
5+
6+
impl<T> LazyLock<T> {
7+
pub const fn new(f: fn() -> T) -> LazyLock<T> {
8+
LazyLock { data: (None, f) }
9+
}
10+
}
11+
12+
struct A<T = i32>(Option<T>);
13+
14+
impl<T> Default for A<T> {
15+
fn default() -> Self {
16+
A(None)
17+
}
18+
}
19+
20+
static EMPTY_SET: LazyLock<A<i32>> = LazyLock::new(A::default);
21+
22+
fn main() {}

tests/crashes/124189.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #124189
2+
trait Trait {
3+
type Type;
4+
}
5+
6+
impl<T> Trait for T {
7+
type Type = ();
8+
}
9+
10+
fn f(_: <&Copy as Trait>::Type) {}
11+
12+
fn main() {
13+
f(());
14+
}

tests/crashes/124207.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #124207
2+
#![feature(transmutability)]
3+
#![feature(type_alias_impl_trait)]
4+
trait OpaqueTrait {}
5+
type OpaqueType = impl OpaqueTrait;
6+
trait AnotherTrait {}
7+
impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
8+
impl AnotherTrait for OpaqueType {}
9+
pub fn main() {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// issue rust-lang/rust#121463
2+
// ICE non-ADT in struct pattern
3+
#![feature(box_patterns)]
4+
5+
fn main() {
6+
let mut a = E::StructVar { boxed: Box::new(5_i32) };
7+
//~^ ERROR failed to resolve: use of undeclared type `E`
8+
match a {
9+
E::StructVar { box boxed } => { }
10+
//~^ ERROR failed to resolve: use of undeclared type `E`
11+
}
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0433]: failed to resolve: use of undeclared type `E`
2+
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
3+
|
4+
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) };
5+
| ^
6+
| |
7+
| use of undeclared type `E`
8+
| help: a trait with a similar name exists: `Eq`
9+
10+
error[E0433]: failed to resolve: use of undeclared type `E`
11+
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
12+
|
13+
LL | E::StructVar { box boxed } => { }
14+
| ^
15+
| |
16+
| use of undeclared type `E`
17+
| help: a trait with a similar name exists: `Eq`
18+
19+
error: aborting due to 2 previous errors
20+
21+
For more information about this error, try `rustc --explain E0433`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// issue: rust-lang/rust#114463
2+
// ICE cannot convert `ReFree ..` to a region vid
3+
#![feature(generic_const_exprs)]
4+
//~^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
5+
fn bug<'a>() {
6+
[(); (|_: &'a u8| (), 0).1];
7+
//~^ ERROR cannot capture late-bound lifetime in constant
8+
}
9+
10+
pub fn main() {}

0 commit comments

Comments
 (0)