mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
19 lines
347 B
Rust
19 lines
347 B
Rust
//@ run-pass
|
|
|
|
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");
|
|
}
|