]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / suggestions / suggest-impl-trait-lifetime.fixed
CommitLineData
0731742a
XL
1// run-rustfix
2
3use std::fmt::Debug;
4
5fn foo(d: impl Debug + 'static) {
74b04a01 6//~^ HELP consider adding an explicit lifetime bound...
0731742a
XL
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
94222f64 12fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
0731742a
XL
13 println!("{:?}", d)
14}
15
16fn main() {
17 foo("hi");
18}