diff --git a/ices/68550.rs b/ices/68550.rs new file mode 100644 index 00000000..1c308475 --- /dev/null +++ b/ices/68550.rs @@ -0,0 +1,9 @@ +fn run<'a, A>(x: A) +where + A: 'static, + &'static A: , +{ + let _: &'a A = &x; +} + +fn main() {} diff --git a/ices/68578.rs b/ices/68578.rs new file mode 100644 index 00000000..a8880c35 --- /dev/null +++ b/ices/68578.rs @@ -0,0 +1,25 @@ +trait Trait { type Resources: Resources; } +impl Trait for () { + type Resources = usize; +} + + +trait ResourceFamily<'a> { type Output; } + +struct UsizeResourceFamily; +impl<'a> ResourceFamily<'a> for UsizeResourceFamily { + type Output = &'a usize; +} + +trait Resources { type Family: for<'a> ResourceFamily<'a>; } +impl Resources for usize { + type Family = UsizeResourceFamily; +} + +fn test() { + let _: Box::Resources as Resources>::Family as ResourceFamily>::Output)> = Box::new(|_| {}); +} + +fn main() { + test::<()>(); +} diff --git a/ices/68596.rs b/ices/68596.rs new file mode 100644 index 00000000..5f3fe671 --- /dev/null +++ b/ices/68596.rs @@ -0,0 +1,17 @@ +#![feature(const_generics)] +#![feature(const_fn)] + +pub struct S(u8); + +impl S { + pub fn get(&self) -> &u8 { + &self.0 + } +} + +fn main() { + const A: u8 = 5; + let s = S(0); + + s.get::(); +}