forked from rust-lang/glacier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2df1a5
commit bd8234c
Showing
3 changed files
with
55 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,22 @@ | ||
#![feature(type_alias_impl_trait)] | ||
#![allow(private_in_public)] | ||
|
||
pub type Successors<'a> = impl Iterator<Item = &'a ()>; | ||
|
||
pub fn f<'a>() -> Successors<'a> { | ||
None.into_iter() | ||
} | ||
|
||
trait Tr { | ||
type Item; | ||
} | ||
|
||
impl<'a> Tr for &'a () { | ||
type Item = Successors<'a>; | ||
} | ||
|
||
pub fn ohno<'a>() -> <&'a () as Tr>::Item { | ||
None.into_iter() | ||
} | ||
|
||
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,5 @@ | ||
#![feature(closure_lifetime_binder)] | ||
|
||
fn main() { | ||
for<const N: i32> || -> () {}; | ||
} |
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,28 @@ | ||
use std::pin::Pin; | ||
|
||
fn main() { | ||
let a = Enum::A(Pin::new(Box::new(A()))); | ||
let b = Enum::B(Pin::new(Box::new(B()))); | ||
println!("{:?} {:?}", a, b); | ||
} | ||
|
||
#[derive(Debug)] | ||
enum Enum { | ||
A(Pin<Box<A>>), | ||
B(Pin<Box<B>>), | ||
} | ||
|
||
#[derive(Debug)] | ||
struct A(); | ||
|
||
impl Drop for Pin<Box<A>> { | ||
fn drop(&mut self) {} | ||
} | ||
|
||
#[derive(Debug)] | ||
struct B(); | ||
|
||
// UNCOMMENT TO FIX COMPILER ERROR | ||
// impl Drop for Pin<Box<B>> { | ||
// fn drop(&mut self) {} | ||
// } |