Skip to content

Instantly share code, notes, and snippets.

@dpchamps
Last active March 6, 2020 18:51
Show Gist options
  • Save dpchamps/881d0cd2cab67ee56de707805a8c75ea to your computer and use it in GitHub Desktop.
Save dpchamps/881d0cd2cab67ee56de707805a8c75ea to your computer and use it in GitHub Desktop.
dead compiler
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>
}
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