This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from JohnTitor/add-ices-0129
Add three ICEs
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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::<()>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); | ||
} |