]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[rust.git] / src / test / ui / suggestions / suggest-impl-trait-lifetime.rs
1 // run-rustfix
2
3 use std::fmt::Debug;
4
5 fn foo(d: impl Debug) {
6 //~^ HELP consider adding an explicit lifetime bound...
7     bar(d);
8 //~^ ERROR the parameter type `impl Debug` may not live long enough
9 //~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
10 }
11
12 fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
13     println!("{:?}", d)
14 }
15
16 fn main() {
17   foo("hi");
18 }