2018-12-12 15:57:47 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
use std::fmt::Debug;
|
|
|
|
|
|
|
|
fn foo(d: impl Debug) {
|
2020-02-19 20:04:03 -06:00
|
|
|
//~^ HELP consider adding an explicit lifetime bound...
|
2018-12-12 15:57:47 -06:00
|
|
|
bar(d);
|
|
|
|
//~^ ERROR the parameter type `impl Debug` may not live long enough
|
|
|
|
//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
|
|
|
|
}
|
|
|
|
|
2022-04-01 12:13:25 -05:00
|
|
|
fn bar(d: impl Debug + 'static) {
|
2018-12-12 15:57:47 -06:00
|
|
|
println!("{:?}", d)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo("hi");
|
|
|
|
}
|