fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
405 B18 linesraw
1// run-rustfix
2
3use std::fmt::Debug;
4
5fn foo(d: impl Debug + 'static) {
6//~^ HELP consider adding an explicit lifetime bound  `'static` to `impl Debug`
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
12fn bar(d: impl Debug + 'static) {
13    println!("{:?}", d)
14}
15
16fn main() {
17  foo("hi");
18}