2018-09-06 07:41:12 -05:00
|
|
|
//@ run-pass
|
|
|
|
|
2017-11-13 13:16:34 -06:00
|
|
|
use std::fmt::Debug;
|
|
|
|
|
|
|
|
trait InTraitDefnParameters {
|
|
|
|
fn in_parameters(_: impl Debug) -> String;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl InTraitDefnParameters for () {
|
|
|
|
fn in_parameters(v: impl Debug) -> String {
|
|
|
|
format!("() + {:?}", v)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let s = <() as InTraitDefnParameters>::in_parameters(22);
|
|
|
|
assert_eq!(s, "() + 22");
|
|
|
|
}
|