Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #274 from JohnTitor/add-ices-0129
Browse files Browse the repository at this point in the history
Add three ICEs
  • Loading branch information
Alexendoo authored Jan 29, 2020
2 parents 1896427 + cad80b3 commit e96ef85
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ices/68550.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fn run<'a, A>(x: A)
where
A: 'static,
&'static A: ,
{
let _: &'a A = &x;
}

fn main() {}
25 changes: 25 additions & 0 deletions ices/68578.rs
Original file line number Diff line number Diff line change
@@ -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<T: Trait>() {
let _: Box<dyn Fn(&mut <<<T as Trait>::Resources as Resources>::Family as ResourceFamily>::Output)> = Box::new(|_| {});
}

fn main() {
test::<()>();
}
17 changes: 17 additions & 0 deletions ices/68596.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![feature(const_generics)]
#![feature(const_fn)]

pub struct S(u8);

impl S {
pub fn get<const A: u8>(&self) -> &u8 {
&self.0
}
}

fn main() {
const A: u8 = 5;
let s = S(0);

s.get::<A>();
}

0 comments on commit e96ef85

Please sign in to comment.