Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(impl_trait_in_bindings)]
- #![feature(maybe_uninit)]
- pub trait Behaviour {}
- pub struct System;
- impl Behaviour for System {}
- fn mk_system() -> impl Behaviour {
- System
- }
- static mut S: impl Behaviour = core::mem::uninitialized();
- fn main() {
- let concrete_system = mk_system();
- core::ptr::write(&mut S, concrete_system);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement