forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#126560 - matthiaskrgr:morecrashes, r=jieyouxu more ice tests r? `@jieyouxu`
- Loading branch information
Showing
13 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ known-bug: rust-lang/rust#126062 | ||
struct Fail<T>(Fail); | ||
impl<T> Fail<i32> { | ||
const C: () = panic!(); | ||
} | ||
|
||
fn f<T>() { | ||
if false { | ||
let _val = &Fail::<T>::C; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//@ known-bug: rust-lang/rust#126148 | ||
|
||
#![feature(effects)] | ||
use std::ops::{FromResidual, Try}; | ||
|
||
struct TryMe; | ||
struct Error; | ||
|
||
impl const FromResidual<Error> for TryMe {} | ||
|
||
impl const Try for TryMe { | ||
type Output = (); | ||
type Residual = Error; | ||
} | ||
|
||
const fn t() -> TryMe { | ||
TryMe?; | ||
TryMe | ||
} | ||
|
||
const _: () = { | ||
t(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//@ known-bug: rust-lang/rust#126182 | ||
|
||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Cond<const B: bool>; | ||
|
||
struct Thing<T = Cond<0>>(T); | ||
|
||
impl Thing {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//@ known-bug: rust-lang/rust#126267 | ||
|
||
#![feature(transmutability)] | ||
#![crate_type = "lib"] | ||
|
||
pub enum ApiError {} | ||
pub struct TokioError { | ||
b: bool, | ||
} | ||
pub enum Error { | ||
Api { source: ApiError }, | ||
Ethereum, | ||
Tokio { source: TokioError }, | ||
} | ||
|
||
mod assert { | ||
use std::mem::BikeshedIntrinsicFrom; | ||
|
||
pub fn is_transmutable<Src, Dst>() | ||
where | ||
Dst: BikeshedIntrinsicFrom<Src>, // safety is NOT assumed | ||
{ | ||
} | ||
} | ||
|
||
fn test() { | ||
struct Src; | ||
type Dst = Error; | ||
assert::is_transmutable::<Src, Dst>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@ known-bug: rust-lang/rust#126269 | ||
#![feature(coerce_unsized)] | ||
|
||
pub enum Foo<T> { | ||
Bar([T; usize::MAX]), | ||
} | ||
|
||
use std::ops::CoerceUnsized; | ||
|
||
impl<T, U> CoerceUnsized<U> for T {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//@ known-bug: rust-lang/rust#126272 | ||
|
||
#![feature(adt_const_params)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::marker::ConstParamTy; | ||
|
||
#[derive(Debug, PartialEq, Eq, ConstParamTy)] | ||
struct Foo { | ||
value: i32, | ||
nested: &'static Bar<std::fmt::Debug>, | ||
} | ||
|
||
#[derive(Debug, PartialEq, Eq, ConstParamTy)] | ||
struct Bar<T>(T); | ||
|
||
struct Test<const F: Foo>; | ||
|
||
fn main() { | ||
let x: Test< | ||
{ | ||
Foo { | ||
value: 3, | ||
nested: &Bar(4), | ||
} | ||
}, | ||
> = Test; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ known-bug: rust-lang/rust#126359 | ||
|
||
struct OppOrder<const N: u8 = 3, T = u32> { | ||
arr: [T; N], | ||
} | ||
|
||
fn main() { | ||
let _ = OppOrder::<3, u32> { arr: [0, 0, 0] }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ known-bug: rust-lang/rust#126376 | ||
mod a { | ||
pub mod b { | ||
pub mod c { | ||
pub trait D {} | ||
} | ||
} | ||
} | ||
|
||
use a::*; | ||
use e as b; | ||
use b::c::D as e; | ||
|
||
fn e() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//@ known-bug: rust-lang/rust#126377 | ||
|
||
#![feature(effects)] | ||
#![feature(generic_const_exprs)] | ||
|
||
mod assert { | ||
use std::mem::{Assume, BikeshedIntrinsicFrom}; | ||
|
||
pub fn is_transmutable< | ||
Src, | ||
Dst, | ||
const ASSUME_ALIGNMENT: bool, | ||
const ASSUME_LIFETIMES: bool, | ||
const ASSUME_SAFETY: bool, | ||
const ASSUME_VALIDITY: bool, | ||
>() | ||
where | ||
Dst: BikeshedIntrinsicFrom< | ||
Src, | ||
{ } | ||
>, | ||
{} | ||
} | ||
|
||
const fn from_options() -> Assume { | ||
#[repr(C)] struct Src; | ||
#[repr(C)] struct Dst; | ||
assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//@ known-bug: rust-lang/rust#126385 | ||
pub struct MyStruct<'field> { | ||
field: &'_ [u32], | ||
} | ||
|
||
impl MyStruct<'_> { | ||
pub fn _<'a>(field: &'a[u32]) -> Self<new> { | ||
Self{field} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ known-bug: rust-lang/rust#126389 | ||
|
||
mod a { | ||
pub mod b { | ||
pub mod c {} | ||
} | ||
} | ||
|
||
use a::*; | ||
|
||
use b::c; | ||
|
||
use c as b; | ||
|
||
fn c() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//@ known-bug: rust-lang/rust#126416 | ||
|
||
trait Output<'a, T: 'a> { | ||
type Type; | ||
} | ||
|
||
struct Wrapper; | ||
|
||
impl Wrapper { | ||
fn do_something_wrapper<O, F>(&mut self, _: F) | ||
where | ||
F: for<'a> FnOnce(<F as Output<i32>>::Type), | ||
{ | ||
} | ||
} | ||
|
||
fn main() { | ||
let mut wrapper = Wrapper; | ||
wrapper.do_something_wrapper(|value| ()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ known-bug: rust-lang/rust#126521 | ||
macro_rules! foo { | ||
($val:ident) => { | ||
true; | ||
}; | ||
} | ||
|
||
fn main() { | ||
#[expect(semicolon_in_expressions_from_macros)] | ||
let _ = foo!(x); | ||
} |