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

Commit 89dff76

Browse files
committed
Add more ICEs
1 parent 36eec0f commit 89dff76

File tree

11 files changed

+137
-0
lines changed

11 files changed

+137
-0
lines changed

ices/75682.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
struct InterruptSectorManager {
2+
field: &'static (),
3+
}
4+
5+
static FOO: [InterruptSectorManager; 2] = [InterruptSectorManager { field: &() }; 2];
6+
7+
fn main() {}

ices/75707.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub trait Callback { fn cb(); }
2+
3+
pub trait Processing {
4+
type Call:Callback;
5+
}
6+
7+
fn f<P:Processing+?Sized>() {
8+
P::Call::cb();
9+
}
10+
11+
fn main() {
12+
struct MyCall;
13+
f::<dyn Processing<Call=MyCall>>();
14+
}

ices/75883.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pub struct UI {}
2+
3+
impl UI {
4+
pub fn run() -> Result<_> {
5+
let mut ui = UI {};
6+
ui.interact();
7+
8+
unimplemented!();
9+
}
10+
11+
pub fn interact(&mut self) -> Result<_> {
12+
unimplemented!();
13+
}
14+
}
15+
16+
fn main() {}

ices/75889.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const /* or static */ FOO: dyn Fn() /* or just fn() */ -> _ = "this can be anything";
2+
3+
fn main() {}

ices/75961.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pub fn foo<'a>(s: &'a mut ()) where &'a mut (): Clone {
2+
<&mut () as Clone>::clone(&s);
3+
}
4+
5+
fn main() {}

ices/75962.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
rustc -Z save-analysis - << EOF
4+
5+
#![feature(type_alias_impl_trait)]
6+
#![feature(impl_trait_in_bindings)]
7+
8+
struct Foo<T>(T);
9+
10+
trait FooLike { type Output; }
11+
12+
impl<T> FooLike for Foo<T> {
13+
type Output = T;
14+
}
15+
16+
17+
// Reduction using `impl Trait` in bindings
18+
19+
mod impl_trait_in_bindings {
20+
struct Foo;
21+
22+
trait FooLike { type Output; }
23+
24+
impl FooLike for Foo {
25+
type Output = u32;
26+
}
27+
28+
trait Trait {
29+
type Assoc;
30+
}
31+
32+
fn foo<T: Trait<Assoc=u32>>() {
33+
let _: impl FooLike<Output=T::Assoc> = Foo;
34+
}
35+
}
36+
37+
fn main() {}
38+
39+
EOF

ices/75983.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(trait_alias)]
2+
3+
struct Bar;
4+
trait Foo {}
5+
impl Foo for Bar {}
6+
7+
trait Baz = Foo where Bar: Foo;
8+
9+
fn new() -> impl Baz {
10+
Bar
11+
}
12+
13+
fn main() {}

ices/76013.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(const_panic)]
2+
3+
const _: () = panic!(String::new());
4+
5+
fn main() {}

ices/76064.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
struct Bug([u8; panic!(1)]);
2+
3+
fn main() {}

ices/76168.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
trait Trait<Input> {
2+
type Output;
3+
}
4+
5+
async fn walk<F: 'static>(filter: F)
6+
where
7+
for<'a> F: Trait<&'a u32> + 'a,
8+
for<'a> <F as Trait<&'a u32>>::Output: 'a,
9+
{
10+
}
11+
12+
fn main() {}

0 commit comments

Comments
 (0)