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

Commit 09dee98

Browse files
authored
Add a few ICEs and move some fixed ones around (#564)
1 parent 20b0628 commit 09dee98

File tree

11 files changed

+207
-0
lines changed

11 files changed

+207
-0
lines changed

ices/51388.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
cat > bar.rs << 'EOF'
4+
pub fn hello_world()
5+
{
6+
println!("hello world");
7+
}
8+
EOF
9+
10+
cat > foo.rs << 'EOF'
11+
extern crate bar;
12+
13+
pub fn foo()
14+
{
15+
bar::hello_world();
16+
}
17+
EOF
18+
19+
rustc --crate-type rlib --emit metadata bar.rs
20+
rustc --crate-type rlib --emit llvm-bc bar.rs
21+
rustc --crate-type rlib --emit llvm-bc foo.rs -L .

ices/52893.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
impl<P, T, Name, F, OLIST, FINAL> AddClass<Name, F> for Class<P, T>
2+
where
3+
Self: At<Name>,
4+
<Class<P, T> as At<Name>>::AtRes: Push<F>,
5+
<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes:
6+
ToRef<Output = Class<P, OLIST>> + Push<OLIST>,
7+
<<<Class<P, T> as At<Name>>::AtRes as Push<F>>::PushRes as Push<OLIST>>::PushRes:
8+
Entry<Data = FINAL>,
9+
{
10+
type Output = Class<P, FINAL>;
11+
12+
fn init(self, func: F) -> Self::Output {
13+
let builder = self.at();
14+
let builder = builder.push(func);
15+
let output = builder.to_ref();
16+
builder.push(output)
17+
}
18+
}
19+
20+
struct Class<P, T> {
21+
path: P,
22+
data: T,
23+
}
24+
25+
trait At<Name> {
26+
type AtRes;
27+
28+
fn at(self) -> Self::AtRes;
29+
}
30+
31+
trait Push<T> {
32+
type PushRes;
33+
34+
fn push(self, other: T) -> Self::PushRes;
35+
}
36+
37+
trait AddClass<Name, F> {
38+
type Output;
39+
40+
fn init(self, func: F) -> Self::Output;
41+
}
42+
43+
trait Entry {
44+
type Data;
45+
}
46+
47+
impl<P, T> Class<P, T> {
48+
fn with<Name, F>(self, constructor: F) -> <Self as AddClass<Name, F>>::Output
49+
where
50+
Self: AddClass<Name, F>,
51+
{
52+
loop {}
53+
}
54+
55+
fn from<F>(self, constructor: F) -> <Self as AddClass<P, F>>::Output
56+
where
57+
Self: AddClass<P, F>,
58+
{
59+
loop {}
60+
}
61+
}
62+
63+
trait ToRef {
64+
type Output;
65+
66+
fn to_ref(&self) -> Self::Output;
67+
}

ices/67684.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
rustc - << 'EOF'
4+
#![crate_type = "lib"]
5+
trait ParseError {
6+
type StreamError;
7+
}
8+
impl<T> ParseError for T {
9+
type StreamError = ();
10+
}
11+
trait Stream {
12+
type Error;
13+
}
14+
trait Parser
15+
where
16+
<Self as Parser>::PartialState: Default,
17+
{
18+
type PartialState;
19+
fn parse_mode(&Self, Self::PartialState) {}
20+
}
21+
struct AndThen<A, B>(core::marker::PhantomData<(A, B)>);
22+
impl<A, B> Parser for AndThen<A, B>
23+
where
24+
A: Stream,
25+
B: Into<<A::Error as ParseError>::StreamError>,
26+
{
27+
type PartialState = ();
28+
}
29+
fn expr<A>() -> impl Parser
30+
where
31+
A: Stream,
32+
{
33+
AndThen::<A, ()>(core::marker::PhantomData)
34+
}
35+
fn parse_mode_impl<A>()
36+
where
37+
A::Error: ParseError,
38+
A: Stream,
39+
{
40+
Parser::parse_mode(&expr::<A>(), Default::default())
41+
}
42+
EOF

ices/73663.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
macro_rules! cbor_map {
2+
($key:expr) => {
3+
$key.signum();
4+
};
5+
}
6+
7+
fn main() {
8+
cbor_map! { #[cfg(test)] 4};
9+
}

ices/78651.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
rustc - <<EOF
4+
use std::result;
5+
impl result {
6+
fn into_future() -> Err {}
7+
}
8+
EOF

ices/80060.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
rustc -Z mir-opt-level=2 -Z instrument-coverage - <<EOF
4+
pub fn main() {
5+
let c = || {};
6+
c();
7+
}
8+
EOF

ices/80062.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn sof<usize>() -> usize {}
2+
fn test<T>() {
3+
let _: [u8; sof::<T>()];
4+
}

ices/80074.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
rustc --edition=2018 -C embed-bitcode=no -C debuginfo=2 --crate-type=lib - << 'EOF'
4+
macro_rules! foo_ { () => {}; }
5+
use foo_ as foo;
6+
EOF
7+
8+
rustc --edition=2018 -C embed-bitcode=no -C debuginfo=2 --extern test_project=$(ls librust_out.*) - << 'EOF'
9+
#[macro_use]
10+
extern crate test_project;
11+
12+
fn main() {
13+
foo!();
14+
}
15+
EOF

ices/80077.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![feature(
2+
const_assume,
3+
const_evaluatable_checked,
4+
const_generics,
5+
use std::intrinsics::assume;
6+
)]
7+
#![allow(incomplete_features)]
8+
9+
const fn foo(n: usize) -> usize { n }
10+
11+
pub struct Bar<const N: usize>(usize);
12+
13+
impl<const N: usize> Bar<N> where [(); foo(N)]: {
14+
fn spam(i: usize) { }
15+
}
16+
17+
fn main() {}

ices/80125.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type ExternCallback = extern "C" fn(*const u8, u32, str);
2+
3+
pub struct Struct(ExternCallback);
4+
5+
#[no_mangle]
6+
pub extern "C" fn register_something(bind: ExternCallback) -> Struct {
7+
Struct(bind)
8+
}
9+
10+
fn main() {}

ices/80134.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let matches = App::new()
3+
.arg(
4+
Arg::with_name(OPT_MODE)é
5+
);
6+
}

0 commit comments

Comments
 (0)