blob: 006923653d045ca7f5bdfead7def7a05fc79e822 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//@ run-pass
use std::fmt::Display;
fn foo(f: impl Display + Clone) -> String {
let g = f.clone();
format!("{} + {}", f, g)
}
fn main() {
let sum = foo(format!("22"));
assert_eq!(sum, r"22 + 22");
}
|