From 32b6a7ce1e12ef79e20a6facea65e01bc4d6b1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 28 Aug 2022 13:17:12 +0200 Subject: [PATCH] add 5 ices https://github.com/rust-lang/rust/issues/101076 https://github.com/rust-lang/rust/issues/101036 https://github.com/rust-lang/rust/issues/101020 https://github.com/rust-lang/rust/issues/101001 https://github.com/rust-lang/rust/issues/100878 --- fixed/100878.rs | 5 +++++ ices/101001.sh | 8 ++++++++ ices/101020.rs | 33 +++++++++++++++++++++++++++++++++ ices/101036.rs | 13 +++++++++++++ ices/101076.sh | 20 ++++++++++++++++++++ 5 files changed, 79 insertions(+) create mode 100644 fixed/100878.rs create mode 100755 ices/101001.sh create mode 100644 ices/101020.rs create mode 100644 ices/101036.rs create mode 100755 ices/101076.sh diff --git a/fixed/100878.rs b/fixed/100878.rs new file mode 100644 index 00000000..ec4077a8 --- /dev/null +++ b/fixed/100878.rs @@ -0,0 +1,5 @@ +#![crate_type = "lib"] +pub fn get_u16_from_unaligned_manual(data: [u8; 1]) -> u8 { + data[0] << 8 +} + diff --git a/ices/101001.sh b/ices/101001.sh new file mode 100755 index 00000000..83862e9c --- /dev/null +++ b/ices/101001.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +rustc --crate-type lib -Zmeta-stats - <<'EOF' + +pub fn a() {} + +EOF + diff --git a/ices/101020.rs b/ices/101020.rs new file mode 100644 index 00000000..54b7ed69 --- /dev/null +++ b/ices/101020.rs @@ -0,0 +1,33 @@ +#![feature(generic_associated_types)] +pub trait LendingIterator { + type Item<'a> + where + Self: 'a; + + fn consume(self, _f: F) + where + Self: Sized, + for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>, + { + } +} + +impl LendingIterator for &mut I { + type Item<'a> = I::Item<'a> where Self: 'a; +} +struct EmptyIter; +impl LendingIterator for EmptyIter { + type Item<'a> = &'a mut () where Self:'a; +} +pub trait FuncInput<'a, F> +where + F: Foo, + Self: Sized, +{ +} +impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo {} +trait Foo {} + +fn map_test() { + (&mut EmptyIter).consume(()); +} diff --git a/ices/101036.rs b/ices/101036.rs new file mode 100644 index 00000000..8d320ee2 --- /dev/null +++ b/ices/101036.rs @@ -0,0 +1,13 @@ +#![feature(generic_const_exprs)] + +const fn t() -> u8 { + N as u8 +} + +#[repr(u8)] +enum T::A as u8 + T::<0>::B as u8 }> +where + [(); N as usize]: +{ + A = t::() as u8, B +} diff --git a/ices/101076.sh b/ices/101076.sh new file mode 100755 index 00000000..3ab61a75 --- /dev/null +++ b/ices/101076.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +cat > out.rs <<'EOF' + +const _: () = { + #[macro_export] + macro_rules! first_macro { + () => {} + } + mod foo { + #[macro_export] + macro_rules! second_macro { + () => {} + } + } +}; + +EOF + +rustdoc out.rs