-
Notifications
You must be signed in to change notification settings - Fork 5
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 #4 from spastorino/erased-handle-lifetimes
Properly handle lifetimes on erased trait generation
- Loading branch information
Showing
10 changed files
with
428 additions
and
50 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 @@ | ||
use dynosaur::dynosaur; | ||
|
||
#[dynosaur(DynMyTrait)] | ||
trait MyTrait { | ||
type Item; | ||
async fn foo(&self) -> Self::Item; | ||
} | ||
|
||
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,24 @@ | ||
#![feature(prelude_import)] | ||
#[prelude_import] | ||
use std::prelude::rust_2021::*; | ||
#[macro_use] | ||
extern crate std; | ||
use dynosaur::dynosaur; | ||
|
||
trait MyTrait { | ||
type Item; | ||
async fn foo(&self) | ||
-> Self::Item; | ||
} | ||
trait ErasedMyTrait { | ||
type Item; | ||
fn foo<'life0, 'dynosaur>(&'life0 self) | ||
-> | ||
::core::pin::Pin<Box<dyn ::core::future::Future<Output = Self::Item> + | ||
'dynosaur>> | ||
where | ||
'life0: 'dynosaur, | ||
Self: 'dynosaur; | ||
} | ||
|
||
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
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
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 @@ | ||
use dynosaur::dynosaur; | ||
|
||
#[dynosaur(DynMyTrait)] | ||
trait MyTrait { | ||
type Item; | ||
async fn foo<T>(&self, x: &T) -> i32; | ||
} | ||
|
||
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,26 @@ | ||
#![feature(prelude_import)] | ||
#[prelude_import] | ||
use std::prelude::rust_2021::*; | ||
#[macro_use] | ||
extern crate std; | ||
use dynosaur::dynosaur; | ||
|
||
trait MyTrait { | ||
type Item; | ||
async fn foo<T>(&self, x: &T) | ||
-> i32; | ||
} | ||
trait ErasedMyTrait { | ||
type Item; | ||
fn foo<'life0, 'life1, 'dynosaur, T>(&'life0 self, x: &'life1 T) | ||
-> | ||
::core::pin::Pin<Box<dyn ::core::future::Future<Output = i32> + | ||
'dynosaur>> | ||
where | ||
T: 'dynosaur, | ||
'life0: 'dynosaur, | ||
'life1: 'dynosaur, | ||
Self: 'dynosaur; | ||
} | ||
|
||
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
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
Oops, something went wrong.