forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#124408 - matthiaskrgr:loltest, r=jieyouxu crashes: add more tests
- Loading branch information
Showing
9 changed files
with
102 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,5 @@ | ||
//@ known-bug: #124262 | ||
//@ edition:2021 | ||
|
||
struct Foo(<&[fn()] as ::core::ops::Deref>::Target); | ||
const _: *const Foo = 0 as _; |
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: #124340 | ||
#![feature(anonymous_lifetime_in_impl_trait)] | ||
|
||
trait Producer { | ||
type Output; | ||
fn produce(self) -> Self::Output; | ||
} | ||
|
||
trait SomeTrait<'a> {} | ||
|
||
fn force_same_lifetime<'a>(_x: &'a i32, _y: impl SomeTrait<'a>) { | ||
unimplemented!() | ||
} | ||
|
||
fn foo<'a>(s: &'a i32, producer: impl Producer<Output: SomeTrait<'_>>) { | ||
force_same_lifetime(s, producer.produce()); | ||
} |
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: #124342 | ||
trait Trait2 : Trait { | ||
reuse <() as Trait>::async { | ||
(async || {}).await; | ||
}; | ||
} |
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,4 @@ | ||
//@ known-bug: #124347 | ||
trait Trait: ToReuse { | ||
reuse Trait::lolno { &self.0 }; | ||
} |
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,7 @@ | ||
//@ known-bug: #124348 | ||
enum Eek { | ||
TheConst, | ||
UnusedByTheConst(Sum), | ||
} | ||
|
||
const EEK_ZERO: &[Eek] = &[]; |
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: #124350 | ||
|
||
struct Node<const D: usize> {} | ||
|
||
impl Node<D> | ||
where | ||
SmallVec<{ D * 2 }>:, | ||
{ | ||
fn new() -> Self { | ||
let mut node = Node::new(); | ||
(&a, 0)(); | ||
|
||
node | ||
} | ||
} | ||
|
||
struct SmallVec<T1, T2> {} |
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,4 @@ | ||
//@ known-bug: #124352 | ||
#![rustc_never_type_options(: Unsize<U> = "hi")] | ||
|
||
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,11 @@ | ||
//@ known-bug: #124375 | ||
//@ compile-flags: -Zmir-opt-level=0 | ||
//@ only-x86_64 | ||
#![crate_type = "lib"] | ||
#![feature(naked_functions)] | ||
use std::arch::asm; | ||
|
||
#[naked] | ||
pub unsafe extern "C" fn naked_with_args_and_return(a: isize, b: isize) -> isize { | ||
asm!("lea rax, [rdi + rsi]", "ret", options(noreturn)); | ||
} |
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,31 @@ | ||
//@ known-bug: #92470 | ||
fn main() { | ||
encode(&mut EncoderImpl); | ||
} | ||
|
||
pub trait Encoder { | ||
type W; | ||
|
||
fn writer(&self) -> Self::W; | ||
} | ||
|
||
fn encode<E: Encoder>(mut encoder: E) { | ||
encoder.writer(); | ||
encode(&mut encoder); | ||
} | ||
|
||
struct EncoderImpl; | ||
|
||
impl Encoder for EncoderImpl { | ||
type W = (); | ||
|
||
fn writer(&self) {} | ||
} | ||
|
||
impl<'a, T: Encoder> Encoder for &'a mut T { | ||
type W = T::W; | ||
|
||
fn writer(&self) -> Self::W { | ||
panic!() | ||
} | ||
} |