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

Add 5 ICEs #521

Merged
merged 1 commit into from Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}