diff --git a/ices/66930.rs b/ices/66930.rs new file mode 100644 index 00000000..4201def3 --- /dev/null +++ b/ices/66930.rs @@ -0,0 +1,7 @@ +#![crate_type = "lib"] + +static UTF8_CHAR_WIDTH: [u8; 0] = []; + +pub fn utf8_char_width(b: u8) -> usize { + UTF8_CHAR_WIDTH[b as usize] as usize +} diff --git a/ices/67514.rs b/ices/67514.rs new file mode 100644 index 00000000..41aa3d1e --- /dev/null +++ b/ices/67514.rs @@ -0,0 +1,5 @@ +#![feature(or_patterns)] + +fn foo((Some(_) | None): Option) {} + +fn main() {} diff --git a/ices/67552.rs b/ices/67552.rs new file mode 100644 index 00000000..5edd27c6 --- /dev/null +++ b/ices/67552.rs @@ -0,0 +1,27 @@ +fn main() { + rec(Empty); +} + +struct Empty; + +impl Iterator for Empty { + type Item = (); + fn next<'a>(&'a mut self) -> core::option::Option<()> { + None + } +} + +fn identity(x: T) -> T { + x +} + +fn rec(mut it: T) +where + T: Iterator, +{ + if () == () { + T::count(it); + } else { + rec(identity(&mut it)) + } +} diff --git a/ices/67739.rs b/ices/67739.rs new file mode 100644 index 00000000..68090ed7 --- /dev/null +++ b/ices/67739.rs @@ -0,0 +1,15 @@ +#![allow(incomplete_features)] +#![feature(const_generics)] + +use std::mem; + +pub trait Trait { + type Associated : Sized; + + fn associated_size(&self) -> usize { + [0u8; mem::size_of::()]; + 0 + } +} + +fn main() {} diff --git a/ices/67830.rs b/ices/67830.rs new file mode 100644 index 00000000..0d615b6c --- /dev/null +++ b/ices/67830.rs @@ -0,0 +1,25 @@ +trait MyFn { + type Output; + fn call(&self, arg: Arg) -> Self::Output; +} + +struct Wrap(F); + +impl MyFn for Wrap +where + F: Fn(A) -> B +{ + type Output = B; + + fn call(&self, arg: A) -> Self::Output { + (self.0)(arg) + } +} + + +struct A; +fn test() -> impl for<'a> MyFn<&'a A, Output=impl Iterator + 'a> { + Wrap(|a| Some(a).into_iter()) +} + +fn main() {} diff --git a/ices/67844.rs b/ices/67844.rs new file mode 100644 index 00000000..a7921e69 --- /dev/null +++ b/ices/67844.rs @@ -0,0 +1,9 @@ +trait WithAssoc { type AssocType; } + +trait WithParam {} + +type Return = impl WithAssoc>; + +fn my_fun() -> Return<()> {} + +fn main() {} diff --git a/ices/67856.rs b/ices/67856.rs new file mode 100644 index 00000000..c740fe15 --- /dev/null +++ b/ices/67856.rs @@ -0,0 +1,13 @@ +#![feature(unboxed_closures)] +#![feature(type_alias_impl_trait)] +#![feature(fn_traits)] + +trait MyTrait {} +impl MyTrait for () {} + +impl FnOnce<()> for &F { + type Output = impl MyTrait ; + fn call_once(self, _:() ) -> Self::Output { } +} + +fn main() {} diff --git a/ices/67858.rs b/ices/67858.rs new file mode 100644 index 00000000..6f9a4ec0 --- /dev/null +++ b/ices/67858.rs @@ -0,0 +1,13 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +pub trait Trait { + type Associated; +} + +pub struct Foo::Associated, const N: u8>(T, A); + +impl Foo { +} + +fn main() {} diff --git a/ices/67883.rs b/ices/67883.rs new file mode 100644 index 00000000..30fab1f0 --- /dev/null +++ b/ices/67883.rs @@ -0,0 +1,18 @@ +#![feature(const_generics)] + +struct Caca { + s: String +} + +impl Default for Caca { + fn default() -> Self { + let a = Self::A; + Self { + s: A.to_string() + } + } +} + +fn main() { + println!("Hello, world!"); +}