From 787a0ccd2914deefe1feb8399faed389222abc1d Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 18:58:42 -0500 Subject: [PATCH 1/6] Add 81403 Issue: rust-lang/rust#81403 --- ices/81403.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ices/81403.sh diff --git a/ices/81403.sh b/ices/81403.sh new file mode 100644 index 00000000..7502bcfd --- /dev/null +++ b/ices/81403.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +rustc --emit=mir -Zmir-opt-level=2 - <<'EOF' +// build-pass +pub trait Foo<'a> { + type Bar; + fn foo(&'a self) -> Self::Bar; +} + +impl<'a, 'b, T: 'a> Foo<'a> for &'b T { + type Bar = &'a T; + fn foo(&'a self) -> &'a T { + self + } +} + +pub fn uncallable(x: T, f: F) + where T: for<'a> Foo<'a>, + F: for<'a> Fn(>::Bar) +{ + f(x.foo()); +} + +pub fn broken(x: &i32, f: F) { + uncallable(x, |y| f(y)); +} + +fn main() { } +EOF From 1cd0e19d9d3ba34179b7d4e95a51eb1c389a9365 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 19:04:39 -0500 Subject: [PATCH 2/6] Add 81270 Issue: rust-lang/rust#81270 --- ices/81270.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ices/81270.rs diff --git a/ices/81270.rs b/ices/81270.rs new file mode 100644 index 00000000..fdb0d5e4 --- /dev/null +++ b/ices/81270.rs @@ -0,0 +1,27 @@ +#![feature(allocator_api)] +use std::alloc::{AllocError, Allocator, Global, Layout}; +use std::marker::PhantomData; +use std::ptr::NonNull; + +struct S { + a: PhantomData, + b: [u8; 1], +} +unsafe impl Allocator for S { + fn allocate(&self, _: Layout) -> Result, AllocError> { + todo!(); + } + unsafe fn deallocate(&self, _: NonNull, _: Layout) { + todo!(); + } +} + +fn main() { + let x: Box> = Box::new_in( + 0, + S { + a: PhantomData, + b: [0; 1], + }, + ); +} From 5c3f17b791fa230878e3f0d352e35399a9386dfa Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 19:07:27 -0500 Subject: [PATCH 3/6] Add 81246 Issue: rust-lang/rust#81246 --- ices/81246.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ices/81246.rs diff --git a/ices/81246.rs b/ices/81246.rs new file mode 100644 index 00000000..1097a38a --- /dev/null +++ b/ices/81246.rs @@ -0,0 +1,9 @@ +#![feature(allocator_api)] + +fn ice() -> Box<(), &'static std::alloc::Global> { + todo!() +} + +fn main() { + ice(); +} From 825477fb6eff079e8839e55c92ea06bfb353d283 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 19:10:18 -0500 Subject: [PATCH 4/6] Add 81193 Issue: rust-lang/rust#81193 --- ices/81193.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ices/81193.rs diff --git a/ices/81193.rs b/ices/81193.rs new file mode 100644 index 00000000..60d397bf --- /dev/null +++ b/ices/81193.rs @@ -0,0 +1,8 @@ +#![feature(associated_type_bounds)] +trait A<'a, 'b> {} +trait B<'a, 'b, 'c> {} +fn err<'u, 'a, F>() +where + for<'b> F: Iterator B<'a, 'b, 'c> + for<'c> A<'a, 'c>>, +{ +} From b1e9a7d46ff3e996e0f8b2f8f6f2e7da4c0d0c9b Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 19:20:36 -0500 Subject: [PATCH 5/6] Add 80561 Issue: rust-lang/rust#80561 --- ices/80561.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ices/80561.rs diff --git a/ices/80561.rs b/ices/80561.rs new file mode 100644 index 00000000..f8f1efc2 --- /dev/null +++ b/ices/80561.rs @@ -0,0 +1,21 @@ +#![feature(const_generics)] +#![feature(const_evaluatable_checked)] +pub struct SimpleStruct([u8; N]); + +impl SimpleStruct { + pub fn new() -> Self { + loop {} + } +} + +pub trait TraitA { + const SIZE: usize; + fn zero() + where + [(); Self::SIZE]: , + { + let _ = SimpleStruct::<{ Self::SIZE }>::new(); + } +} + +fn main() {} From edc5c22197e5758b42e6c23411fa1d3ec654a796 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 29 Jan 2021 20:15:21 -0500 Subject: [PATCH 6/6] Kill rustfmt --- ices/81270.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/ices/81270.rs b/ices/81270.rs index fdb0d5e4..5dc50ea9 100644 --- a/ices/81270.rs +++ b/ices/81270.rs @@ -1,12 +1,9 @@ #![feature(allocator_api)] -use std::alloc::{AllocError, Allocator, Global, Layout}; -use std::marker::PhantomData; +use std::alloc::{Layout, Allocator, Global, AllocError}; use std::ptr::NonNull; +use std::marker::PhantomData; -struct S { - a: PhantomData, - b: [u8; 1], -} +struct S{ a: PhantomData, b: [u8; 1] } unsafe impl Allocator for S { fn allocate(&self, _: Layout) -> Result, AllocError> { todo!(); @@ -17,11 +14,5 @@ unsafe impl Allocator for S { } fn main() { - let x: Box> = Box::new_in( - 0, - S { - a: PhantomData, - b: [0; 1], - }, - ); -} + let x: Box> = Box::new_in(0, S { a: PhantomData, b: [0; 1] }); +} \ No newline at end of file