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() {} 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>>, +{ +} 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(); +} diff --git a/ices/81270.rs b/ices/81270.rs new file mode 100644 index 00000000..5dc50ea9 --- /dev/null +++ b/ices/81270.rs @@ -0,0 +1,18 @@ +#![feature(allocator_api)] +use std::alloc::{Layout, Allocator, Global, AllocError}; +use std::ptr::NonNull; +use std::marker::PhantomData; + +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] }); +} \ No newline at end of file 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