From 1dc3cb0353afc1acfd630d19c66fee56902159c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 21 Aug 2022 10:59:25 +0200 Subject: [PATCH 1/2] add 5 ices https://github.com/rust-lang/rust/issues/100771 https://github.com/rust-lang/rust/issues/100772 https://github.com/rust-lang/rust/issues/100778 https://github.com/rust-lang/rust/issues/100783 https://github.com/rust-lang/rust/issues/100818 --- ices/100771.sh | 24 ++++++++++++++++++++++++ ices/100772.sh | 12 ++++++++++++ ices/100778.sh | 24 ++++++++++++++++++++++++ ices/100783.sh | 19 +++++++++++++++++++ ices/100818.rs | 9 +++++++++ 5 files changed, 88 insertions(+) create mode 100755 ices/100771.sh create mode 100755 ices/100772.sh create mode 100755 ices/100778.sh create mode 100755 ices/100783.sh create mode 100644 ices/100818.rs 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..f1076be2 --- /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 {}); +} From 53ef4591e7ec8fa97a911fa39c0f11c8701fe1f6 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Mon, 22 Aug 2022 12:53:43 +0100 Subject: [PATCH 2/2] Remove tabs from 100778.sh --- ices/100778.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ices/100778.sh b/ices/100778.sh index f1076be2..f62bdc28 100755 --- a/ices/100778.sh +++ b/ices/100778.sh @@ -11,9 +11,9 @@ const EMPTY_MATRIX: Matrix = [0; 1]; pub struct Walk { } impl Walk { - pub const fn new() -> Self { - Self {} - } + pub const fn new() -> Self { + Self {} + } } fn main() {