From 8ee390353cf0f0987383d2b7c1623c22bb213411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 6 Aug 2022 07:25:23 +0200 Subject: [PATCH] add 6 ices https://github.com/rust-lang/rust/issues/100075 https://github.com/rust-lang/rust/issues/100103 https://github.com/rust-lang/rust/issues/100114 https://github.com/rust-lang/rust/issues/100143 https://github.com/rust-lang/rust/issues/100183 https://github.com/rust-lang/rust/issues/100187 --- ices/100075.rs | 19 +++++++++++++++++++ ices/100103.rs | 9 +++++++++ ices/100114.rs | 13 +++++++++++++ ices/100143.sh | 27 +++++++++++++++++++++++++++ ices/100183.rs | 5 +++++ ices/100187.sh | 19 +++++++++++++++++++ 6 files changed, 92 insertions(+) create mode 100644 ices/100075.rs create mode 100644 ices/100103.rs create mode 100644 ices/100114.rs create mode 100755 ices/100143.sh create mode 100644 ices/100183.rs create mode 100755 ices/100187.sh diff --git a/ices/100075.rs b/ices/100075.rs new file mode 100644 index 00000000..af7cc4e7 --- /dev/null +++ b/ices/100075.rs @@ -0,0 +1,19 @@ +trait Marker {} +impl Marker for T {} + +fn maybe(_t: T) -> + Option< + //removing the line below makes it compile + &'static + T> { + None +} + +fn _g(t: &'static T) -> &'static impl Marker { + if let Some(t) = maybe(t) { + return _g(t); + } + todo!() +} + +pub fn main() {} diff --git a/ices/100103.rs b/ices/100103.rs new file mode 100644 index 00000000..3b2b2bb8 --- /dev/null +++ b/ices/100103.rs @@ -0,0 +1,9 @@ +#![feature(let_else)] +fn main() { + let Some(x) = Some(()) else { + match Err(()) { + Err(()) => return (), + Ok(val) => val, + } + }; +} diff --git a/ices/100114.rs b/ices/100114.rs new file mode 100644 index 00000000..caf59e1d --- /dev/null +++ b/ices/100114.rs @@ -0,0 +1,13 @@ +#![allow(warnings)] +#![feature(never_type)] +#![allow(const_err)] + +use std::mem::MaybeUninit; + +const fn never() -> ! { + unsafe { MaybeUninit::uninit().assume_init() } +} + +const NEVER: ! = never(); + +fn main() {} diff --git a/ices/100143.sh b/ices/100143.sh new file mode 100755 index 00000000..14d93a62 --- /dev/null +++ b/ices/100143.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cat > out.rs <<'EOF' + +// struct Peekable +use std::iter::Peekable; + +pub struct Span { + inner: Peekable>, +} + +struct ConditionalIterator { + f: F, +} + +impl Iterator for ConditionalIterator { + type Item = (); + + fn next(&mut self) -> Option { + todo!() + } +} + +EOF + +rustdoc --edition=2021 out.rs + diff --git a/ices/100183.rs b/ices/100183.rs new file mode 100644 index 00000000..38821245 --- /dev/null +++ b/ices/100183.rs @@ -0,0 +1,5 @@ +struct Struct { + y: (typeof("hey"),), +} + +pub fn main() {} diff --git a/ices/100187.sh b/ices/100187.sh new file mode 100755 index 00000000..3b5edd9a --- /dev/null +++ b/ices/100187.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +rustc "-Zcrate-attr=feature(with_negative_coherence)" - <<'EOF' + +#![feature(negative_impls)] + +// FIXME: this should compile + +trait MyPredicate<'a> {} +impl<'a, T> !MyPredicate<'a> for &T where T: 'a {} +trait MyTrait<'a> {} +impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} +impl<'a, T> MyTrait<'a> for &'a T {} +//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` + +fn main() {} + +EOF +