]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-27592.stderr
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-27592.stderr
index 74b0541c01b2f68e867f8387f04ce74c0dc5c1e3..9d3eaa9705d443ec212f377ed582d61a941dd195 100644 (file)
@@ -1,21 +1,21 @@
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/issue-27592.rs:26:27
+error[E0515]: cannot return value referencing temporary value
+  --> $DIR/issue-27592.rs:16:14
    |
 LL |     write(|| format_args!("{}", String::from("Hello world")));
-   |                           ^^^^                             -- temporary value needs to live until here
-   |                           |                                |
-   |                           |                                temporary value dropped here while still borrowed
-   |                           temporary value does not live long enough
+   |              ^^^^^^^^^^^^^^^^^^^---------------------------^
+   |              |                  |
+   |              |                  temporary value created here
+   |              returns a value referencing data owned by the current function
 
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/issue-27592.rs:26:33
+error[E0515]: cannot return value referencing temporary value
+  --> $DIR/issue-27592.rs:16:14
    |
 LL |     write(|| format_args!("{}", String::from("Hello world")));
-   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^-- temporary value needs to live until here
-   |                                 |                          |
-   |                                 |                          temporary value dropped here while still borrowed
-   |                                 temporary value does not live long enough
+   |              ^^^^^^^^^^^^^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |              |            |
+   |              |            temporary value created here
+   |              returns a value referencing 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`.