rust/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
613 B
Rust
Raw Normal View History

2022-05-22 05:36:12 +00:00
// FIXME(nll): On NLL stabilization, this should be replaced by
// `suggest-impl-trait-lifetime-nll.rs`. Compiletest has
// problems with rustfix and revisions.
// ignore-compare-mode-nll
// run-rustfix
use std::fmt::Debug;
fn foo(d: impl Debug + 'static) {
//~^ HELP consider adding an explicit lifetime bound...
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) { //~ NOTE ...that is required by this bound
println!("{:?}", d)
}
fn main() {
foo("hi");
}