Last active
March 6, 2020 18:51
-
-
Save dpchamps/881d0cd2cab67ee56de707805a8c75ea to your computer and use it in GitHub Desktop.
dead compiler
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
use std::ptr::NonNull; | |
pub type Object = Box<Block<dyn Allocation>>; | |
pub type ObjectRef<T: 'static + ?Sized + Allocation> = NonNull<Block<T>>; | |
pub trait Allocation {} | |
struct Block<T: 'static + ?Sized + Allocation>{ | |
data : T | |
} | |
struct Heap { | |
objects : Vec<Object> | |
} |
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
use std::ptr::NonNull; | |
pub trait SomeTrait {} | |
struct SomeGeneric<T>{ | |
field : T | |
} | |
pub type SomeType<T: 'static + SomeTrait + ?Sized> = SomeGeneric<T>; | |
fn main() { | |
println!("Hello, world!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment