2017-11-13 14:27:58 -05:00
|
|
|
use std::fmt::Display;
|
|
|
|
|
|
|
|
fn foo(f: impl Display + Clone) -> String {
|
|
|
|
wants_debug(f);
|
|
|
|
wants_display(f);
|
2018-05-21 09:56:52 +02:00
|
|
|
wants_clone(f);
|
2017-11-13 14:27:58 -05:00
|
|
|
}
|
|
|
|
|
2019-07-15 03:28:17 +03: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 09:56:52 +02:00
|
|
|
fn wants_clone(g: impl Clone) { }
|
2017-11-13 14:27:58 -05:00
|
|
|
|
2019-07-15 03:28:17 +03:00
|
|
|
fn main() {}
|