2018-09-06 07:41:12 -05:00
|
|
|
// run-pass
|
|
|
|
|
2017-11-13 13:27:58 -06:00
|
|
|
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");
|
|
|
|
}
|