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

Commit

Permalink
Merge pull request #521 from oliviacrain/changes
Browse files Browse the repository at this point in the history
Add 5 ICEs
  • Loading branch information
Alexendoo committed Oct 28, 2020
2 parents d60e2dd + 1363203 commit fdaae30
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ices/78441.sh
@@ -0,0 +1,8 @@
#!/bin/bash

rustc -Z save-analysis - << EOF
fn main() {
[(); { for _ in 0usize.. {}; 0}];
}
EOF
19 changes: 19 additions & 0 deletions ices/78442.sh
@@ -0,0 +1,19 @@
#!/bin/bash

rustc -Z mir-opt-level=2 - << EOF
#![crate_type = "lib"]
// Error won't happen if "bar" is not generic
pub fn bar<P>(_baz: P) {
hide_foo()();
}
// Error won't happen if "iterate" hasn't impl Trait or has generics
fn hide_foo() -> impl Fn() {
foo
}
// Error won't happen if "foo" isn't used in "iterate" or has generics
fn foo() {}
EOF
25 changes: 25 additions & 0 deletions ices/78450.rs
@@ -0,0 +1,25 @@
#![feature(type_alias_impl_trait)]
#![no_std]
#![crate_type = "lib"]

pub trait AssociatedImpl {
type ImplTrait;

fn f() -> Self::ImplTrait;
}

trait DynTrait<'a> {}

struct S<T>(T);

trait Associated {
type A;
}

impl<'a, T: Associated<A = dyn DynTrait<'a>>> AssociatedImpl for S<T> {
type ImplTrait = impl core::future::Future<Output = ()>;

fn f() -> Self::ImplTrait {
async { () }
}
}
22 changes: 22 additions & 0 deletions ices/78456.rs
@@ -0,0 +1,22 @@
#![feature(type_alias_impl_trait)]
#![no_std]

pub trait Tr<'x> {
type Fut: core::future::Future<Output = ()>;

fn f() -> Self::Fut;
}

impl<'x> Tr<'x> for () {
type Fut = impl core::future::Future<Output = ()>;

fn f() -> Self::Fut {
async {
//if false {
return ();
//}
let res: Undef = ();
res
}
}
}
5 changes: 5 additions & 0 deletions ices/78459.rs
@@ -0,0 +1,5 @@
#![feature(allocator_api)]

fn main() {
Box::new_in(&[0, 1], &std::alloc::Global);
}

0 comments on commit fdaae30

Please sign in to comment.