mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-29 16:13:40 +00:00
19 lines
395 B
Rust
19 lines
395 B
Rust
|
// run-rustfix
|
||
|
|
||
|
use std::fmt::Debug;
|
||
|
|
||
|
fn foo(d: impl Debug) {
|
||
|
//~^ HELP consider adding an explicit lifetime bound `'static` to `impl Debug`
|
||
|
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
|
||
|
}
|
||
|
|
||
|
fn bar(d: impl Debug + 'static) {
|
||
|
println!("{:?}", d)
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
foo("hi");
|
||
|
}
|