]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/regions/regions-creating-enums.stderr
Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
[rust.git] / src / test / ui / regions / regions-creating-enums.stderr
index bb11be9b7581153d20cc2f1578a241231a6c48da..a95d84629013ead53a2de1e9ca3d02b2fc1d61f7 100644 (file)
@@ -1,33 +1,21 @@
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/regions-creating-enums.rs:23:17
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/regions-creating-enums.rs:23:16
    |
 LL |         return &Ast::Num((*f)(x));
-   |                 ^^^^^^^^^^^^^^^^^- temporary value only lives until here
-   |                 |
-   |                 temporary value does not live long enough
-   |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 20:13...
-  --> $DIR/regions-creating-enums.rs:20:13
-   |
-LL | fn map_nums<'a,'b, F>(x: &Ast, f: &mut F) -> &'a Ast<'b> where F: FnMut(usize) -> usize {
-   |             ^^
-   = note: consider using a `let` binding to increase its lifetime
+   |                ^-----------------
+   |                ||
+   |                |temporary value created here
+   |                returns a reference to data owned by the current function
 
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/regions-creating-enums.rs:28:17
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/regions-creating-enums.rs:28:16
    |
 LL |         return &Ast::Add(m_x, m_y);
-   |                 ^^^^^^^^^^^^^^^^^^- temporary value only lives until here
-   |                 |
-   |                 temporary value does not live long enough
-   |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 20:13...
-  --> $DIR/regions-creating-enums.rs:20:13
-   |
-LL | fn map_nums<'a,'b, F>(x: &Ast, f: &mut F) -> &'a Ast<'b> where F: FnMut(usize) -> usize {
-   |             ^^
-   = note: consider using a `let` binding to increase its lifetime
+   |                ^------------------
+   |                ||
+   |                |temporary value created here
+   |                returns a reference to data owned by the current function
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0515`.