2017-11-13 13:27:58 -06:00
|
|
|
use std::fmt::Display;
|
|
|
|
|
|
|
|
fn foo(f: impl Display + Clone) -> String {
|
|
|
|
wants_debug(f);
|
|
|
|
wants_display(f);
|
2018-05-21 02:56:52 -05:00
|
|
|
wants_clone(f);
|
2017-11-13 13:27:58 -06:00
|
|
|
}
|
|
|
|
|
2019-07-14 19:28:17 -05:00
|
|
|
fn wants_debug(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
|
|
|
|
fn wants_display(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
|
2018-05-21 02:56:52 -05:00
|
|
|
fn wants_clone(g: impl Clone) { }
|
2017-11-13 13:27:58 -06:00
|
|
|
|
2019-07-14 19:28:17 -05:00
|
|
|
fn main() {}
|