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 #1353 from matthiaskrgr/2107
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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) {} | ||
// } |