mirror of https://github.com/rust-lang/rust.git
Rollup merge of #128036 - matthiaskrgr:ccrashes, r=jieyouxu
add more tests r? `@jieyouxu`
This commit is contained in:
commit
526b4c9070
|
@ -0,0 +1,17 @@
|
|||
//@ known-bug: #127351
|
||||
#![feature(lazy_type_alias)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct Outer0<'a, T>(ExplicitTypeOutlives<'a, T>);
|
||||
type ExplicitTypeOutlives<'a, T: 'a> = (&'a (), T);
|
||||
|
||||
pub struct Warns {
|
||||
_significant_drop: ExplicitTypeOutlives,
|
||||
field: String,
|
||||
}
|
||||
|
||||
pub fn test(w: Warns) {
|
||||
_ = || drop(w.field);
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,18 @@
|
|||
//@ known-bug: #127353
|
||||
#![feature(type_alias_impl_trait)]
|
||||
trait Trait<T> {}
|
||||
type Alias<'a, U> = impl Trait<U>;
|
||||
|
||||
fn f<'a>() -> Alias<'a, ()> {}
|
||||
|
||||
pub enum UninhabitedVariants {
|
||||
Tuple(Alias),
|
||||
}
|
||||
|
||||
struct A;
|
||||
|
||||
fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(x: UninhabitedVariants) -> A {
|
||||
match x {}
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,14 @@
|
|||
//@ known-bug: #127628
|
||||
//@ compile-flags: -Zpolonius=next
|
||||
|
||||
use std::io::{self, Read};
|
||||
|
||||
pub struct Container<'a> {
|
||||
reader: &'a mut dyn Read,
|
||||
}
|
||||
|
||||
impl<'a> Container {
|
||||
pub fn wrap<'s>(reader: &'s mut dyn io::Read) -> Container<'s> {
|
||||
Container { reader: reader }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
//@ known-bug: #127643
|
||||
|
||||
#![feature(associated_const_equality)]
|
||||
|
||||
fn user() -> impl Owner<dyn Sized, C = 0> {}
|
||||
|
||||
trait Owner<K> {
|
||||
const C: K;
|
||||
}
|
||||
impl<K: ConstDefault> Owner<K> for () {
|
||||
const C: K = K::DEFAULT;
|
||||
}
|
||||
|
||||
trait ConstDefault {
|
||||
const DEFAULT: Self;
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,8 @@
|
|||
//@ known-bug: #127676
|
||||
//@ edition:2018
|
||||
|
||||
#![feature(dyn_star,const_async_blocks)]
|
||||
|
||||
static S: dyn* Send + Sync = async { 42 };
|
||||
|
||||
pub fn main() {}
|
|
@ -0,0 +1,21 @@
|
|||
//@ known-bug: #127737
|
||||
//@ compile-flags: -Zmir-opt-level=5 --crate-type lib
|
||||
|
||||
pub trait TestTrait {
|
||||
type MyType;
|
||||
fn func() -> Option<Self>
|
||||
where
|
||||
Self: Sized;
|
||||
}
|
||||
|
||||
impl<T> dyn TestTrait<MyType = T>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
pub fn other_func() -> Option<Self> {
|
||||
match Self::func() {
|
||||
Some(me) => Some(me),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
//@ known-bug: #127742
|
||||
struct Vtable(dyn Cap); // missing lifetime
|
||||
|
||||
trait Cap<'a> {}
|
||||
|
||||
union Transmute {
|
||||
t: u64, // ICEs with u64, u128, or usize. Correctly errors with u32.
|
||||
u: &'static Vtable,
|
||||
}
|
||||
|
||||
const G: &'static Vtable = unsafe { Transmute { t: 1 }.u };
|
|
@ -0,0 +1,5 @@
|
|||
//@ known-bug: #127880
|
||||
//@ compile-flags: -Cinstrument-coverage
|
||||
|
||||
#[coverage]
|
||||
fn main() {}
|
|
@ -0,0 +1,16 @@
|
|||
//@ known-bug: #127916
|
||||
|
||||
trait Trait {
|
||||
fn foo(&self) -> u32 { 0 }
|
||||
}
|
||||
|
||||
struct F;
|
||||
struct S;
|
||||
|
||||
mod to_reuse {
|
||||
pub fn foo(&self) -> u32 {}
|
||||
}
|
||||
|
||||
impl Trait S {
|
||||
reuse to_reuse::foo { self }
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
//@ known-bug: #127962
|
||||
#![feature(generic_const_exprs)]
|
||||
|
||||
fn zero_init<const usize: usize>() -> Substs1<{ (N) }> {
|
||||
Substs1([0; { (usize) }])
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
//@ known-bug: #128016
|
||||
macro_rules! len {
|
||||
() => {
|
||||
target
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let val: [str; len!()] = [];
|
||||
}
|
Loading…
Reference in New Issue