diff --git a/ices/100771.sh b/ices/100771.sh new file mode 100755 index 00000000..6b270119 --- /dev/null +++ b/ices/100771.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rustc -Zextra-const-ub-checks - <<'EOF' + +#[derive(PartialEq, Eq, Copy, Clone)] +#[repr(packed)] +struct Foo { + field: (i64, u32, u32, u32), +} + +const FOO: Foo = Foo { + field: (5, 6, 7, 8), +}; + +fn main() { + match FOO { + Foo { field: (5, 6, 7, 8) } => {}, + FOO => unreachable!(), //~ WARNING unreachable pattern + _ => unreachable!(), + } +} + +EOF + diff --git a/ices/100772.sh b/ices/100772.sh new file mode 100755 index 00000000..af9c7ae4 --- /dev/null +++ b/ices/100772.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +rustc -Clto -Zsanitizer=cfi - <<'EOF' + +#![feature(allocator_api)] + +fn main() { + Box::new_in(&[0, 1], &std::alloc::Global); +} + +EOF + diff --git a/ices/100778.sh b/ices/100778.sh new file mode 100755 index 00000000..f62bdc28 --- /dev/null +++ b/ices/100778.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rustc -Clto -Zsanitizer=cfi - <<'EOF' + +#![feature(adt_const_params, generic_const_exprs)] +#![allow(incomplete_features)] + +pub type Matrix = [usize; 1]; +const EMPTY_MATRIX: Matrix = [0; 1]; + +pub struct Walk { } + +impl Walk { + pub const fn new() -> Self { + Self {} + } +} + +fn main() { + let _ = Walk::new(); +} + +EOF + diff --git a/ices/100783.sh b/ices/100783.sh new file mode 100755 index 00000000..6abe4b1e --- /dev/null +++ b/ices/100783.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +rustc -Cdebuginfo=2 -Zsanitizer=cfi -Clto - <<'EOF' + +// run-pass +trait Stream { type Item; } +impl<'a> Stream for &'a str { type Item = u8; } +fn f<'s>(s: &'s str) -> (&'s str, <&'s str as Stream>::Item) { + (s, 42) +} + +fn main() { + let fx = f as for<'t> fn(&'t str) -> (&'t str, <&'t str as Stream>::Item); + assert_eq!(fx("hi"), ("hi", 42)); +} + + +EOF + diff --git a/ices/100818.rs b/ices/100818.rs new file mode 100644 index 00000000..1f836ee4 --- /dev/null +++ b/ices/100818.rs @@ -0,0 +1,9 @@ +#![feature(type_alias_impl_trait)] +use std::future::Future; + +fn main() { + type SomeFuture<'t> = impl 't + Future; + type SomeClosure = impl for<'t> FnOnce(&'t str) -> SomeFuture<'t>; + fn coerce_closure(f: SomeClosure) {} + coerce_closure(|x: &str| async move {}); +}