From cb73b167a4845102e5f7d6c480c04a964fd63f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 17 Jul 2022 07:32:48 +0200 Subject: [PATCH] add latest batch of ICEs https://github.com/rust-lang/rust/issues/99318 https://github.com/rust-lang/rust/issues/99319 https://github.com/rust-lang/rust/issues/99325 https://github.com/rust-lang/rust/issues/99331 https://github.com/rust-lang/rust/issues/99348 https://github.com/rust-lang/rust/issues/99363 --- ices/99318.sh | 15 +++++++++++++++ ices/99319.sh | 13 +++++++++++++ ices/99325.sh | 18 ++++++++++++++++++ ices/99331.sh | 10 ++++++++++ ices/99348.rs | 25 +++++++++++++++++++++++++ ices/99363.sh | 19 +++++++++++++++++++ 6 files changed, 100 insertions(+) create mode 100755 ices/99318.sh create mode 100755 ices/99319.sh create mode 100755 ices/99325.sh create mode 100755 ices/99331.sh create mode 100644 ices/99348.rs create mode 100755 ices/99363.sh diff --git a/ices/99318.sh b/ices/99318.sh new file mode 100755 index 00000000..d856b475 --- /dev/null +++ b/ices/99318.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +rustc -Zunpretty=hir - <<'EOF' + +#![feature(let_else)] + +pub fn main() { + let Some(x) = &Some(3) else { + panic!(); + }; + *x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference +} + +EOF + diff --git a/ices/99319.sh b/ices/99319.sh new file mode 100755 index 00000000..f8d612da --- /dev/null +++ b/ices/99319.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +rustc -Zunpretty=hir - <<'EOF' + +#![feature(let_else)] + +fn main() { + let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else` + let true = true || false else { return }; //~ ERROR a `||` expression cannot be directly assigned in `let...else` +} + +EOF + diff --git a/ices/99325.sh b/ices/99325.sh new file mode 100755 index 00000000..58393777 --- /dev/null +++ b/ices/99325.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +rustc -Zunpretty=mir - <<'EOF' + +#![feature(adt_const_params)] +#![allow(incomplete_features)] + +pub fn function_with_bytes() -> &'static [u8] { + BYTES +} + +pub fn main() { + assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); + assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); +} + +EOF + diff --git a/ices/99331.sh b/ices/99331.sh new file mode 100755 index 00000000..6769e387 --- /dev/null +++ b/ices/99331.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +rustc -Zunpretty=expanded - <<'EOF' + +extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI + +fn main() { } + +EOF + diff --git a/ices/99348.rs b/ices/99348.rs new file mode 100644 index 00000000..b58b776e --- /dev/null +++ b/ices/99348.rs @@ -0,0 +1,25 @@ +#![feature(type_alias_impl_trait)] + +struct Concrete; + +type Tait = impl Sized; + +impl Foo for Concrete { + type Item = Concrete; +} + +impl Bar for Concrete { + type Other = Tait; +} + +trait Foo { + type Item: Bar; +} + +trait Bar { + type Other; +} + +fn tait() -> Tait {} + +pub fn main() {} diff --git a/ices/99363.sh b/ices/99363.sh new file mode 100755 index 00000000..230377be --- /dev/null +++ b/ices/99363.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +rustc --edition=2021 - <<'EOF' + +#![feature(type_alias_impl_trait)] + +#[derive(Copy, Clone)] +struct Foo((u32, u32)); + +fn main() { + type T = impl Copy; + let foo: T = Foo((1u32, 2u32)); + let x = move || { + let Foo((a, b)) = foo; + }; +} + +EOF +