From 1363203c91167589095d100509aa9fa1c6528064 Mon Sep 17 00:00:00 2001 From: Olivia Crain Date: Tue, 27 Oct 2020 20:30:59 -0500 Subject: [PATCH] Add 5 ICEs --- ices/78441.sh | 8 ++++++++ ices/78442.sh | 19 +++++++++++++++++++ ices/78450.rs | 25 +++++++++++++++++++++++++ ices/78456.rs | 22 ++++++++++++++++++++++ ices/78459.rs | 5 +++++ 5 files changed, 79 insertions(+) create mode 100644 ices/78441.sh create mode 100644 ices/78442.sh create mode 100644 ices/78450.rs create mode 100644 ices/78456.rs create mode 100644 ices/78459.rs diff --git a/ices/78441.sh b/ices/78441.sh new file mode 100644 index 00000000..78bbc62d --- /dev/null +++ b/ices/78441.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +rustc -Z save-analysis - << EOF +fn main() { + [(); { for _ in 0usize.. {}; 0}]; +} + +EOF diff --git a/ices/78442.sh b/ices/78442.sh new file mode 100644 index 00000000..4f0a2ee6 --- /dev/null +++ b/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

(_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 diff --git a/ices/78450.rs b/ices/78450.rs new file mode 100644 index 00000000..b764298c --- /dev/null +++ b/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); + +trait Associated { + type A; +} + +impl<'a, T: Associated>> AssociatedImpl for S { + type ImplTrait = impl core::future::Future; + + fn f() -> Self::ImplTrait { + async { () } + } +} diff --git a/ices/78456.rs b/ices/78456.rs new file mode 100644 index 00000000..2966a35f --- /dev/null +++ b/ices/78456.rs @@ -0,0 +1,22 @@ +#![feature(type_alias_impl_trait)] +#![no_std] + +pub trait Tr<'x> { + type Fut: core::future::Future; + + fn f() -> Self::Fut; +} + +impl<'x> Tr<'x> for () { + type Fut = impl core::future::Future; + + fn f() -> Self::Fut { + async { + //if false { + return (); + //} + let res: Undef = (); + res + } + } +} diff --git a/ices/78459.rs b/ices/78459.rs new file mode 100644 index 00000000..2ab5369e --- /dev/null +++ b/ices/78459.rs @@ -0,0 +1,5 @@ +#![feature(allocator_api)] + +fn main() { + Box::new_in(&[0, 1], &std::alloc::Global); +}