From b7ae32b5ecd342f45a4d59a22f71d401da434a52 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 26 Feb 2021 17:47:40 -0500 Subject: [PATCH 1/6] Add 77708 Issue: rust-lang/rust#77708 --- ices/77708.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ices/77708.sh diff --git a/ices/77708.sh b/ices/77708.sh new file mode 100644 index 00000000..2f3c4a70 --- /dev/null +++ b/ices/77708.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +rustc --edition 2018 -C incremental=foo --crate-type lib - <<'EOF' +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] +use core::{convert::TryFrom, num::NonZeroUsize}; + +struct A([u8; N.get()]) where [u8; N.get()]: Sized; + +impl<'a, const N: NonZeroUsize> TryFrom<&'a [u8]> for A where [u8; N.get()]: Sized { + type Error = (); + fn try_from(slice: &'a [u8]) -> Result, ()> { + let _x = <&[u8; N.get()] as TryFrom<&[u8]>>::try_from(slice); + unimplemented!(); + } +} +EOF From 4062451ec8935fe61687004e214fd8a933c9eb43 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 26 Feb 2021 14:54:02 -0500 Subject: [PATCH 2/6] Add 82418 Issue: rust-lang/rust#82418 --- ices/82418.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ices/82418.rs diff --git a/ices/82418.rs b/ices/82418.rs new file mode 100644 index 00000000..3664a48f --- /dev/null +++ b/ices/82418.rs @@ -0,0 +1,25 @@ +#![feature(const_generics)] +#![feature(const_evaluatable_checked)] + +pub struct Foobar { + t: T, +} + +pub trait Footrait { + const N: usize; +} + +impl Footrait for T { + const N: usize = 0; +} + +pub fn new_foo(t: T) -> Foobar::N }> +where + T: Footrait, +{ + Foobar { t } +} + +fn main() { + let foo = new_foo(0); +} From 80c0c06ebcdbfff257da678c91c85c58d6941f39 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 26 Feb 2021 14:45:47 -0500 Subject: [PATCH 3/6] Add 82438 This is actually rust-lang/rust#82526, a minimized duplicate of 82438. Issue: rust-lang/rust#82438 --- ices/82438.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ices/82438.rs diff --git a/ices/82438.rs b/ices/82438.rs new file mode 100644 index 00000000..e13e1b5f --- /dev/null +++ b/ices/82438.rs @@ -0,0 +1,8 @@ +fn main() { + let inner; + let outer = || { + inner = || {}; + inner(); + }; + outer(); +} From d4e9f0f56d21bd3df5db83684d034809870b55be Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 26 Feb 2021 14:56:53 -0500 Subject: [PATCH 4/6] Add 82455 Issue: rust-lang/rust#82455 --- ices/82455.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ices/82455.rs diff --git a/ices/82455.rs b/ices/82455.rs new file mode 100644 index 00000000..ebb12f38 --- /dev/null +++ b/ices/82455.rs @@ -0,0 +1,12 @@ +fn map(_: fn() -> Option<&'static T>) -> Option { + None +} + +fn value() -> Option<&'static _> { + Option::<&'static u8>::None +} + +const _: Option<_> = { + + let _: Option<_> = map(value); +}; From 5bc1798006265ca0a663f513c834af3e0332ca22 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Fri, 26 Feb 2021 14:49:51 -0500 Subject: [PATCH 5/6] Add 82504 Issue: rust-lang/rust#82504 --- ices/82504.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ices/82504.rs diff --git a/ices/82504.rs b/ices/82504.rs new file mode 100644 index 00000000..1d8168c8 --- /dev/null +++ b/ices/82504.rs @@ -0,0 +1,17 @@ +#![crate_type = "lib"] +#![feature(decl_macro)] + +pub mod module { + mod private { + __helper__! { [$] recurse } + + macro __helper__ ([$dol:tt] $exported_name:ident) { + macro_rules! $exported_name {() => ()} + pub(crate) use $exported_name; + } + // pub(crate) use recurse; + } + pub(super) use private::recurse; +} + +module::recurse!(); From d75f8370e7ebe8fd33a8e987a50a9d8c6ae138e1 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 27 Feb 2021 12:43:21 +0900 Subject: [PATCH 6/6] Fix style issues --- ices/77708.sh | 10 +++++----- ices/82455.rs | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ices/77708.sh b/ices/77708.sh index 2f3c4a70..f5eae1af 100644 --- a/ices/77708.sh +++ b/ices/77708.sh @@ -8,10 +8,10 @@ use core::{convert::TryFrom, num::NonZeroUsize}; struct A([u8; N.get()]) where [u8; N.get()]: Sized; impl<'a, const N: NonZeroUsize> TryFrom<&'a [u8]> for A where [u8; N.get()]: Sized { - type Error = (); - fn try_from(slice: &'a [u8]) -> Result, ()> { - let _x = <&[u8; N.get()] as TryFrom<&[u8]>>::try_from(slice); - unimplemented!(); - } + type Error = (); + fn try_from(slice: &'a [u8]) -> Result, ()> { + let _x = <&[u8; N.get()] as TryFrom<&[u8]>>::try_from(slice); + unimplemented!(); + } } EOF diff --git a/ices/82455.rs b/ices/82455.rs index ebb12f38..099ed19d 100644 --- a/ices/82455.rs +++ b/ices/82455.rs @@ -7,6 +7,5 @@ fn value() -> Option<&'static _> { } const _: Option<_> = { - let _: Option<_> = map(value); };