Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(unsize)]
- use std::fmt::Debug;
- use std::marker::Unsize;
- use std::rc::Rc;
- fn convert<T>(x: T) -> Rc<dyn Debug>
- where
- T: Into<Rc<T>>,
- T: Unsize<dyn Debug>,
- {
- x.into()
- }
- fn foo() {
- convert(Rc::new(1) as Rc<Debug>);
- convert(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement