forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#130491 - matthiaskrgr:sehsarc, r=compiler-e…
…rrors more crash tests r? `@compiler-errors`
- Loading branch information
Showing
7 changed files
with
97 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,19 @@ | ||
//@ known-bug: #120016 | ||
//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) --edition=2021 | ||
|
||
#![feature(type_alias_impl_trait, const_async_blocks)] | ||
|
||
struct Bug { | ||
V1: [(); { | ||
type F = impl std::future::Future<Output = impl Sized>; | ||
fn concrete_use() -> F { | ||
//~^ ERROR to be a future that resolves to `u8`, but it resolves to `()` | ||
async {} | ||
} | ||
let f: F = async { 1 }; | ||
//~^ ERROR `async` blocks are not allowed in constants | ||
1 | ||
}], | ||
} | ||
|
||
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,12 @@ | ||
//@ known-bug: #127804 | ||
|
||
struct Thing; | ||
|
||
pub trait Every { | ||
type Assoc; | ||
} | ||
impl<T: ?Sized> Every for Thing { | ||
type Assoc = T; | ||
} | ||
|
||
fn foo(_: <Thing as Every>::Assoc) {} |
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: #128119 | ||
|
||
trait Trait { | ||
reuse to_reuse::foo { self } | ||
} | ||
|
||
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,15 @@ | ||
//@ known-bug: #128232 | ||
|
||
#![feature(generic_const_exprs, unsized_const_params)] | ||
|
||
fn function() {} | ||
|
||
struct Wrapper<const F: fn()>; | ||
|
||
impl Wrapper<{ bar() }> { | ||
fn call() {} | ||
} | ||
|
||
fn main() { | ||
Wrapper::<function>::call; | ||
} |
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: #130411 | ||
trait Project { | ||
const SELF: Self; | ||
} | ||
|
||
fn take1(_: Project<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,17 @@ | ||
//@ known-bug: #130413 | ||
|
||
#![feature(transmutability)] | ||
trait Aaa { | ||
type Y; | ||
} | ||
|
||
trait Bbb { | ||
type B: std::mem::TransmuteFrom<()>; | ||
} | ||
|
||
impl<T> Bbb for T | ||
where | ||
T: Aaa, | ||
{ | ||
type B = T::Y; | ||
} |
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: #130425 | ||
//@ compile-flags: -Zmir-opt-level=5 -Zpolymorphize=on | ||
|
||
struct S<T>(T) | ||
where | ||
[T; ( | ||
|_: u8| { | ||
static FOO: Sync = AtomicUsize::new(0); | ||
unsafe { &*(&FOO as *const _ as *const usize) } | ||
}, | ||
1, | ||
) | ||
.1]: Copy; |