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

Commit e96ef85

Browse files
authored
Merge pull request #274 from JohnTitor/add-ices-0129
Add three ICEs
2 parents 1896427 + cad80b3 commit e96ef85

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

ices/68550.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn run<'a, A>(x: A)
2+
where
3+
A: 'static,
4+
&'static A: ,
5+
{
6+
let _: &'a A = &x;
7+
}
8+
9+
fn main() {}

ices/68578.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
trait Trait { type Resources: Resources; }
2+
impl Trait for () {
3+
type Resources = usize;
4+
}
5+
6+
7+
trait ResourceFamily<'a> { type Output; }
8+
9+
struct UsizeResourceFamily;
10+
impl<'a> ResourceFamily<'a> for UsizeResourceFamily {
11+
type Output = &'a usize;
12+
}
13+
14+
trait Resources { type Family: for<'a> ResourceFamily<'a>; }
15+
impl Resources for usize {
16+
type Family = UsizeResourceFamily;
17+
}
18+
19+
fn test<T: Trait>() {
20+
let _: Box<dyn Fn(&mut <<<T as Trait>::Resources as Resources>::Family as ResourceFamily>::Output)> = Box::new(|_| {});
21+
}
22+
23+
fn main() {
24+
test::<()>();
25+
}

ices/68596.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![feature(const_generics)]
2+
#![feature(const_fn)]
3+
4+
pub struct S(u8);
5+
6+
impl S {
7+
pub fn get<const A: u8>(&self) -> &u8 {
8+
&self.0
9+
}
10+
}
11+
12+
fn main() {
13+
const A: u8 = 5;
14+
let s = S(0);
15+
16+
s.get::<A>();
17+
}

0 commit comments

Comments
 (0)