Created
April 20, 2019 05:15
-
-
Save rust-play/1da8c24402235f567a2b25162cdf1676 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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
pub trait Trait<T: std::fmt::Debug> { | |
fn display(&self, t: T) { | |
println!("{:?}", t); | |
} | |
} | |
pub struct Dummy; | |
impl<T: std::fmt::Debug> Trait<T> for Dummy{} | |
fn main() { | |
<Trait<i32>>::display(&Dummy, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment