-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124046 - matthiaskrgr:one_or_two_more_tests____some_on…
…_top, r=jieyouxu crashes: add even more tests?!? adds more tests that were not already added with #124038 from the past 10 months or so. Need a couple more passes through the tracker to filter out more missing ice /fixed tests but we're slowly getting there.
- Loading branch information
Showing
27 changed files
with
723 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,26 @@ | ||
//@ known-bug: #112623 | ||
|
||
#![feature(const_trait_impl, effects)] | ||
|
||
#[const_trait] | ||
trait Value { | ||
fn value() -> u32; | ||
} | ||
|
||
const fn get_value<T: ~const Value>() -> u32 { | ||
T::value() | ||
} | ||
|
||
struct FortyTwo; | ||
|
||
impl const Value for FortyTwo { | ||
fn value() -> i64 { | ||
42 | ||
} | ||
} | ||
|
||
const FORTY_TWO: u32 = get_value::<FortyTwo>(); | ||
|
||
fn main() { | ||
assert_eq!(FORTY_TWO, 42); | ||
} |
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: #114198 | ||
//@ compile-flags: -Zprint-mono-items=eager | ||
|
||
impl Trait for <Ty as Owner>::Struct {} | ||
trait Trait { | ||
fn test(&self) {} | ||
} | ||
|
||
enum Ty {} | ||
trait Owner { type Struct: ?Sized; } | ||
impl Owner for Ty { | ||
type Struct = dyn Trait + Send; | ||
} | ||
|
||
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,13 @@ | ||
//@ known-bug: #114198 | ||
//@ compile-flags: -Zprint-mono-items=eager | ||
|
||
#![feature(lazy_type_alias)] | ||
|
||
impl Trait for Struct {} | ||
trait Trait { | ||
fn test(&self) {} | ||
} | ||
|
||
type Struct = dyn Trait + Send; | ||
|
||
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,26 @@ | ||
//@ known-bug: #118185 | ||
|
||
fn main() { | ||
let target: Target = create_target(); | ||
target.get(0); // correct arguments work | ||
target.get(10.0); // CRASH HERE | ||
} | ||
|
||
// must be generic | ||
fn create_target<T>() -> T { | ||
unimplemented!() | ||
} | ||
|
||
// unimplemented trait, but contains function with the same name | ||
pub trait RandomTrait { | ||
fn get(&mut self); // but less arguments | ||
} | ||
|
||
struct Target; | ||
|
||
impl Target { | ||
// correct function with arguments | ||
pub fn get(&self, data: i32) { | ||
unimplemented!() | ||
} | ||
} |
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: #120421 | ||
//@ compile-flags: -Zlint-mir | ||
|
||
#![feature(never_patterns)] | ||
|
||
enum Void {} | ||
|
||
fn main() { | ||
let res_void: Result<bool, Void> = Ok(true); | ||
|
||
for (Ok(mut _x) | Err(!)) in [res_void] {} | ||
} |
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: #120792 | ||
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes | ||
|
||
impl Trait<()> for () { | ||
fn foo<'a, K>(self, _: (), _: K) { | ||
todo!(); | ||
} | ||
} | ||
|
||
trait Foo<T> {} | ||
|
||
impl<F, T> Foo<T> for F { | ||
fn main() { | ||
().foo((), ()); | ||
} | ||
} | ||
|
||
trait Trait<T> { | ||
fn foo<'a, K>(self, _: T, _: K) | ||
where | ||
T: 'a, | ||
K: 'a; | ||
} | ||
|
||
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,27 @@ | ||
//@ known-bug: #120811 | ||
|
||
trait Container { | ||
type Item<'a>; | ||
} | ||
impl Container for () { | ||
type Item<'a> = (); | ||
} | ||
struct Exchange<C, F> { | ||
_marker: std::marker::PhantomData<(C, F)>, | ||
} | ||
fn exchange<C, F>(_: F) -> Exchange<C, F> | ||
where | ||
C: Container, | ||
for<'a> F: FnMut(&C::Item<'a>), | ||
{ | ||
unimplemented!() | ||
} | ||
trait Parallelization<C> {} | ||
impl<C, F> Parallelization<C> for Exchange<C, F> {} | ||
fn unary_frontier<P: Parallelization<()>>(_: P) {} | ||
fn main() { | ||
let exchange = exchange(|_| ()); | ||
let _ = || { | ||
unary_frontier(exchange); | ||
}; | ||
} |
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: #121063 | ||
//@ compile-flags: -Zpolymorphize=on --edition=2021 -Zinline-mir=yes | ||
|
||
use std::{ | ||
fmt, ops, | ||
path::{Component, Path, PathBuf}, | ||
}; | ||
|
||
pub struct AbsPathBuf(PathBuf); | ||
|
||
impl TryFrom<PathBuf> for AbsPathBuf { | ||
type Error = PathBuf; | ||
fn try_from(path: impl AsRef<Path>) -> Result<AbsPathBuf, PathBuf> {} | ||
} | ||
|
||
impl TryFrom<&str> for AbsPathBuf { | ||
fn try_from(path: &str) -> Result<AbsPathBuf, PathBuf> { | ||
AbsPathBuf::try_from(PathBuf::from(path)) | ||
} | ||
} |
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,22 @@ | ||
//@ known-bug: #121127 | ||
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes | ||
|
||
#![feature(specialization)] | ||
|
||
pub trait Foo { | ||
fn abc() -> u32; | ||
} | ||
|
||
pub trait Marker {} | ||
|
||
impl<T> Foo for T { | ||
default fn abc(f: fn(&T), t: &T) -> u32 { | ||
16 | ||
} | ||
} | ||
|
||
impl<T: Marker> Foo for T { | ||
fn def() -> u32 { | ||
Self::abc() | ||
} | ||
} |
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: #123456 | ||
|
||
trait Project { | ||
const SELF: Self; | ||
} | ||
|
||
fn take1( | ||
_: Project< | ||
SELF = { | ||
j2.join().unwrap(); | ||
}, | ||
>, | ||
) { | ||
} | ||
|
||
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,5 @@ | ||
//@ known-bug: #123461 | ||
|
||
fn main() { | ||
let _: [_; unsafe { std::mem::transmute(|o_b: Option<_>| {}) }]; | ||
} |
Oops, something went wrong.