-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #129135 - matthiaskrgr:ITKEEPSCRASHINGAAAAAAAAHH, r=c…
…ompiler-errors crashes: more tests r? ````@jieyouxu````
- Loading branch information
Showing
9 changed files
with
131 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#128695 | ||
//@ edition: 2021 | ||
|
||
use core::pin::{pin, Pin}; | ||
|
||
fn main() { | ||
let fut = pin!(async { | ||
let async_drop_fut = pin!(core::future::async_drop(async {})); | ||
(async_drop_fut).await; | ||
}); | ||
} |
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,25 @@ | ||
//@ known-bug: rust-lang/rust#128810 | ||
|
||
#![feature(fn_delegation)] | ||
|
||
use std::marker::PhantomData; | ||
|
||
pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); | ||
|
||
impl<'a> InvariantRef<'a, ()> { | ||
pub const NEW: Self = InvariantRef::new(&()); | ||
} | ||
|
||
trait Trait { | ||
fn foo(&self) -> u8 { 0 } | ||
fn bar(&self) -> u8 { 1 } | ||
fn meh(&self) -> u8 { 2 } | ||
} | ||
|
||
struct Z(u8); | ||
|
||
impl Trait for Z { | ||
reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } | ||
} | ||
|
||
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,5 @@ | ||
//@ known-bug: rust-lang/rust#128848 | ||
|
||
fn f<T>(a: T, b: T, c: T) { | ||
f.call_once() | ||
} |
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,18 @@ | ||
//@ known-bug: rust-lang/rust#128870 | ||
//@ compile-flags: -Zvalidate-mir | ||
|
||
#[repr(packed)] | ||
#[repr(u32)] | ||
enum E { | ||
A, | ||
B, | ||
C, | ||
} | ||
|
||
fn main() { | ||
union InvalidTag { | ||
int: u32, | ||
e: E, | ||
} | ||
let _invalid_tag = InvalidTag { int: 4 }; | ||
} |
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,16 @@ | ||
//@ known-bug: rust-lang/rust#129075 | ||
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes | ||
|
||
struct Foo<T>([T; 2]); | ||
|
||
impl<T: Default + Copy> Default for Foo<T> { | ||
fn default(&mut self) -> Self { | ||
Foo([Default::default(); 2]) | ||
} | ||
} | ||
|
||
fn field_array() { | ||
let a: i32; | ||
let b; | ||
Foo([a, b]) = Default::default(); | ||
} |
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#129095 | ||
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir | ||
|
||
pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] { | ||
BYTES | ||
} | ||
|
||
pub fn main() { | ||
assert_eq!(function_with_bytes::<b"AAAAb">(), &[0x41, 0x41, 0x41, 0x41]); | ||
} |
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#129099 | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
fn dyn_hoops<T: Sized>() -> dyn for<'a> Iterator<Item = impl Captures<'a>> { | ||
loop {} | ||
} | ||
|
||
pub fn main() { | ||
type Opaque = impl Sized; | ||
fn define() -> Opaque { | ||
let x: Opaque = dyn_hoops::<()>(0); | ||
x | ||
} | ||
} |
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#129109 | ||
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir | ||
|
||
extern "C" { | ||
pub static mut symbol: [i8]; | ||
} | ||
|
||
fn main() { | ||
println!("C", unsafe { &symbol }); | ||
} |
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,21 @@ | ||
//@ known-bug: rust-lang/rust#129127 | ||
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always | ||
|
||
|
||
|
||
|
||
pub struct Rows<'a>(); | ||
|
||
impl<'a> Iterator for Rows<'a> { | ||
type Item = (); | ||
|
||
fn next() -> Option<Self::Item> { | ||
let mut rows = Rows(); | ||
rows.map(|row| row).next() | ||
} | ||
} | ||
|
||
fn main() { | ||
let mut rows = Rows(); | ||
rows.next(); | ||
} |