diff --git a/ices/77708.sh b/ices/77708.sh new file mode 100644 index 00000000..f5eae1af --- /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 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); +} 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(); +} diff --git a/ices/82455.rs b/ices/82455.rs new file mode 100644 index 00000000..099ed19d --- /dev/null +++ b/ices/82455.rs @@ -0,0 +1,11 @@ +fn map(_: fn() -> Option<&'static T>) -> Option { + None +} + +fn value() -> Option<&'static _> { + Option::<&'static u8>::None +} + +const _: Option<_> = { + let _: Option<_> = map(value); +}; 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!();