From f9139632ef855734e263a98f26a8b12c318d3572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 19 Aug 2022 19:01:45 +0200 Subject: [PATCH 1/2] move 86800.rs back to ices --- {fixed => ices}/86800.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {fixed => ices}/86800.rs (100%) diff --git a/fixed/86800.rs b/ices/86800.rs similarity index 100% rename from fixed/86800.rs rename to ices/86800.rs From 2291d391f3bedfa6a4bc06f44525d6a57093086a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 19 Aug 2022 19:46:03 +0200 Subject: [PATCH 2/2] add 5 ices https://github.com/rust-lang/rust/issues/100689 https://github.com/rust-lang/rust/issues/100672 https://github.com/rust-lang/rust/issues/100612 https://github.com/rust-lang/rust/issues/100550 https://github.com/rust-lang/rust/issues/100463 --- ices/100463.rs | 14 ++++++++++++++ ices/100550.sh | 31 +++++++++++++++++++++++++++++++ ices/100612.sh | 25 +++++++++++++++++++++++++ ices/100672.rs | 15 +++++++++++++++ ices/100689.rs | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+) create mode 100644 ices/100463.rs create mode 100755 ices/100550.sh create mode 100755 ices/100612.sh create mode 100644 ices/100672.rs create mode 100644 ices/100689.rs diff --git a/ices/100463.rs b/ices/100463.rs new file mode 100644 index 00000000..a3386897 --- /dev/null +++ b/ices/100463.rs @@ -0,0 +1,14 @@ +struct Foo { + inner: Vec, +} + +impl Foo { + fn get(&self) -> impl Iterator { + self.inner.iter() + } +} + +fn main() { + let foo: Foo<()> = Foo { inner: Vec::new() }; + let vals: Vec<_> = foo.get(); +} diff --git a/ices/100550.sh b/ices/100550.sh new file mode 100755 index 00000000..c166456e --- /dev/null +++ b/ices/100550.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +rustc -Copt-level=2 --crate-type lib - <<'EOF' + +pub trait Trait { + type Associated; +} +impl Trait for T { + type Associated = T; +} + +pub struct Struct(::Associated); + +pub fn foo() -> Struct +where + T: Trait, +{ + bar() +} + +#[inline] +fn bar() -> Struct { + Struct(baz()) +} + +fn baz() -> T { + unimplemented!() +} + +EOF + diff --git a/ices/100612.sh b/ices/100612.sh new file mode 100755 index 00000000..455bed53 --- /dev/null +++ b/ices/100612.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +rustc "-Cdebuginfo=2" - <<'EOF' + +// run-pass +#![feature(repr128, arbitrary_enum_discriminant)] +//~^ WARN the feature `repr128` is incomplete + +#[derive(PartialEq, Debug)] +#[repr(i128)] +enum Test { + A(Box) = 0, + B(usize) = u64::MAX as i128 + 1, +} + +fn main() { + assert_ne!(Test::A(Box::new(2)), Test::B(0)); + // This previously caused a segfault. + // + // See https://github.com/rust-lang/rust/issues/70509#issuecomment-620654186 + // for a detailed explanation. +} + +EOF + diff --git a/ices/100672.rs b/ices/100672.rs new file mode 100644 index 00000000..80668dd4 --- /dev/null +++ b/ices/100672.rs @@ -0,0 +1,15 @@ +#![feature(generic_associated_types)] + +trait Bar<'a> { + type Ref<'b> + where + 'a: 'b; + fn uwu(f: impl Fn(Self::Ref<'_>)); +} + +impl<'a> Bar<'a> for () { + type Ref<'b> = () where 'a: 'b; + fn uwu(f: impl Fn(())) {} +} + +pub fn main() {} diff --git a/ices/100689.rs b/ices/100689.rs new file mode 100644 index 00000000..b5be9fe0 --- /dev/null +++ b/ices/100689.rs @@ -0,0 +1,35 @@ +#![feature(generic_associated_types)] + +struct Foo<'a> { + foo: &'a mut usize, +} + +trait Bar<'a> { + type FooRef<'b> + where + 'a : 'b, + ; + fn uwu ( + foo: Foo<'a>, + f: impl for<'b> FnMut(Self::FooRef<'b>), + ) + ; +} +impl<'a> Bar<'a> for () { + type FooRef<'b> + = + &'b Foo<'a> + where + 'a : 'b, + ; + + fn uwu ( + foo: Foo<'a>, + mut f: impl for<'b> FnMut(&'b Foo<'a>), //relevant part + ) + { + f(&foo); + } +} + +fn main() {}