Skip to content

Commit bdd37a7

Browse files
authored
Unrolled build for rust-lang#128036
Rollup merge of rust-lang#128036 - matthiaskrgr:ccrashes, r=jieyouxu add more tests r? `@jieyouxu`
2 parents 20f23ab + 5ab2e40 commit bdd37a7

11 files changed

+144
-0
lines changed

tests/crashes/127351.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: #127351
2+
#![feature(lazy_type_alias)]
3+
#![allow(incomplete_features)]
4+
5+
struct Outer0<'a, T>(ExplicitTypeOutlives<'a, T>);
6+
type ExplicitTypeOutlives<'a, T: 'a> = (&'a (), T);
7+
8+
pub struct Warns {
9+
_significant_drop: ExplicitTypeOutlives,
10+
field: String,
11+
}
12+
13+
pub fn test(w: Warns) {
14+
_ = || drop(w.field);
15+
}
16+
17+
fn main() {}

tests/crashes/127353.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #127353
2+
#![feature(type_alias_impl_trait)]
3+
trait Trait<T> {}
4+
type Alias<'a, U> = impl Trait<U>;
5+
6+
fn f<'a>() -> Alias<'a, ()> {}
7+
8+
pub enum UninhabitedVariants {
9+
Tuple(Alias),
10+
}
11+
12+
struct A;
13+
14+
fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(x: UninhabitedVariants) -> A {
15+
match x {}
16+
}
17+
18+
fn main() {}

tests/crashes/127628.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #127628
2+
//@ compile-flags: -Zpolonius=next
3+
4+
use std::io::{self, Read};
5+
6+
pub struct Container<'a> {
7+
reader: &'a mut dyn Read,
8+
}
9+
10+
impl<'a> Container {
11+
pub fn wrap<'s>(reader: &'s mut dyn io::Read) -> Container<'s> {
12+
Container { reader: reader }
13+
}
14+
}

tests/crashes/127643.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #127643
2+
3+
#![feature(associated_const_equality)]
4+
5+
fn user() -> impl Owner<dyn Sized, C = 0> {}
6+
7+
trait Owner<K> {
8+
const C: K;
9+
}
10+
impl<K: ConstDefault> Owner<K> for () {
11+
const C: K = K::DEFAULT;
12+
}
13+
14+
trait ConstDefault {
15+
const DEFAULT: Self;
16+
}
17+
18+
fn main() {}

tests/crashes/127676.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ known-bug: #127676
2+
//@ edition:2018
3+
4+
#![feature(dyn_star,const_async_blocks)]
5+
6+
static S: dyn* Send + Sync = async { 42 };
7+
8+
pub fn main() {}

tests/crashes/127737.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ known-bug: #127737
2+
//@ compile-flags: -Zmir-opt-level=5 --crate-type lib
3+
4+
pub trait TestTrait {
5+
type MyType;
6+
fn func() -> Option<Self>
7+
where
8+
Self: Sized;
9+
}
10+
11+
impl<T> dyn TestTrait<MyType = T>
12+
where
13+
Self: Sized,
14+
{
15+
pub fn other_func() -> Option<Self> {
16+
match Self::func() {
17+
Some(me) => Some(me),
18+
None => None,
19+
}
20+
}
21+
}

tests/crashes/127742.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #127742
2+
struct Vtable(dyn Cap); // missing lifetime
3+
4+
trait Cap<'a> {}
5+
6+
union Transmute {
7+
t: u64, // ICEs with u64, u128, or usize. Correctly errors with u32.
8+
u: &'static Vtable,
9+
}
10+
11+
const G: &'static Vtable = unsafe { Transmute { t: 1 }.u };

tests/crashes/127880.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: #127880
2+
//@ compile-flags: -Cinstrument-coverage
3+
4+
#[coverage]
5+
fn main() {}

tests/crashes/127916.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #127916
2+
3+
trait Trait {
4+
fn foo(&self) -> u32 { 0 }
5+
}
6+
7+
struct F;
8+
struct S;
9+
10+
mod to_reuse {
11+
pub fn foo(&self) -> u32 {}
12+
}
13+
14+
impl Trait S {
15+
reuse to_reuse::foo { self }
16+
}

tests/crashes/127972.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #127962
2+
#![feature(generic_const_exprs)]
3+
4+
fn zero_init<const usize: usize>() -> Substs1<{ (N) }> {
5+
Substs1([0; { (usize) }])
6+
}

tests/crashes/128016.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #128016
2+
macro_rules! len {
3+
() => {
4+
target
5+
};
6+
}
7+
8+
fn main() {
9+
let val: [str; len!()] = [];
10+
}

0 commit comments

Comments
 (0)