Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 02951ab

Browse files
authored
Merge pull request #1211 from matthiaskrgr/apr09
add 7 ices
2 parents 9a0ed99 + a7f679d commit 02951ab

File tree

7 files changed

+93
-0
lines changed

7 files changed

+93
-0
lines changed

ices/95628.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
type T = impl Sized;
4+
5+
struct Foo;
6+
7+
impl Into<T> for Foo {
8+
fn into(self) -> T {}
9+
}
10+
11+
fn main(){
12+
let _: T = Foo.into();
13+
}

ices/95640.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
rustc -Zmir-opt-level=3 - 2>&1 << EOF
2+
3+
struct D;
4+
5+
trait Tr {
6+
type It;
7+
fn foo(self) -> Option<Self::It>;
8+
}
9+
10+
impl<'a> Tr for &'a D {
11+
type It = ();
12+
fn foo(self) -> Option<()> { None }
13+
}
14+
15+
fn run<F>(f: F)
16+
where for<'a> &'a D: Tr,
17+
F: Fn(<&D as Tr>::It),
18+
{
19+
let d = &D;
20+
while let Some(i) = d.foo() {
21+
f(i);
22+
}
23+
}
24+
25+
fn main() {
26+
run(|_| {});
27+
}
28+
29+
EOF

ices/95647-1.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
trait Tr<T> {
2+
type Output;
3+
}
4+
5+
impl<T> Tr<T> for () {
6+
type Output = T;
7+
}
8+
9+
fn g() -> impl for<'a> Tr<&'a u8, Output = impl std::fmt::Debug + 'a> { }
10+
11+
pub fn main() {}

ices/95647-2.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
trait Tr<'a> {
2+
type Assoc;
3+
}
4+
5+
impl<'a> Tr<'a> for () {
6+
type Assoc = &'a ();
7+
}
8+
9+
fn g() -> impl for<'a> Tr<'a, Assoc = impl Send + 'a> {}

ices/95665.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub trait Trait: {}
2+
3+
pub struct Struct<T: Trait> {
4+
member: T,
5+
}
6+
7+
// uncomment and bug goes away
8+
//impl Trait for u8 {}
9+
10+
extern "C" {
11+
static VAR: Struct<u8>;
12+
}
13+
14+
fn main() {}

ices/95823.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(ptr_metadata)]
2+
3+
pub struct S;
4+
5+
impl S
6+
where
7+
():,
8+
{
9+
fn f<T: ?Sized>(_: <T as core::ptr::Pointee>::Metadata) {}
10+
}
11+
12+
pub fn main() {}

ices/95829.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern {
2+
async fn L() {
3+
async fn M() {}
4+
}
5+
}

0 commit comments

Comments
 (0)