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#128036 - matthiaskrgr:ccrashes, r=jieyouxu add more tests r? `@jieyouxu`
- Loading branch information
Showing
11 changed files
with
144 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,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() {} |
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: #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() {} |
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: #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 } | ||
} | ||
} |
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: #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() {} |
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,8 @@ | ||
//@ known-bug: #127676 | ||
//@ edition:2018 | ||
|
||
#![feature(dyn_star,const_async_blocks)] | ||
|
||
static S: dyn* Send + Sync = async { 42 }; | ||
|
||
pub 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,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, | ||
} | ||
} | ||
} |
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: #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 }; |
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: #127880 | ||
//@ compile-flags: -Cinstrument-coverage | ||
|
||
#[coverage] | ||
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,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 } | ||
} |
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,6 @@ | ||
//@ known-bug: #127962 | ||
#![feature(generic_const_exprs)] | ||
|
||
fn zero_init<const usize: usize>() -> Substs1<{ (N) }> { | ||
Substs1([0; { (usize) }]) | ||
} |
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: #128016 | ||
macro_rules! len { | ||
() => { | ||
target | ||
}; | ||
} | ||
|
||
fn main() { | ||
let val: [str; len!()] = []; | ||
} |