]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
Rollup merge of #95504 - jyn514:library-alias, r=Mark-Simulacrum
[rust.git] / src / test / ui / impl-trait / must_outlive_least_region_or_bound.rs
index 69d2843ff3f01b0f5184ee1c15209d638ad71a53..baa42da64468d51e991df9dff9b649f339e35e17 100644 (file)
@@ -31,12 +31,13 @@ fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } //~ ERRO
 // Tests that a closure type containing 'b cannot be returned from a type where
 // only 'a was expected.
 fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
-    //~^ ERROR: captures lifetime that does not appear in bounds
     move |_| println!("{}", y)
+    //~^ ERROR: captures lifetime that does not appear in bounds
 }
 
 fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
     //~^ ERROR the parameter type `T` may not live long enough
+    //~| ERROR the parameter type `T` may not live long enough
     x
 }