diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/macros/return_from_external_macro.rs | 2 | ||||
| -rw-r--r-- | tests/ui/macros/return_from_external_macro.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/macros/return_from_external_macro.rs b/tests/ui/macros/return_from_external_macro.rs index 43fe99e63ad..91d0c4c64fd 100644 --- a/tests/ui/macros/return_from_external_macro.rs +++ b/tests/ui/macros/return_from_external_macro.rs @@ -5,7 +5,7 @@ extern crate ret_from_ext; fn foo() -> impl Sized { drop(|| ret_from_ext::foo!()); - //~^ ERROR cannot return reference to local binding + //~^ ERROR cannot return reference to temporary value ret_from_ext::foo!() //~^ ERROR temporary value dropped while borrowed diff --git a/tests/ui/macros/return_from_external_macro.stderr b/tests/ui/macros/return_from_external_macro.stderr index b6010b8ec79..6f707b9f52b 100644 --- a/tests/ui/macros/return_from_external_macro.stderr +++ b/tests/ui/macros/return_from_external_macro.stderr @@ -1,11 +1,11 @@ -error[E0515]: cannot return reference to local binding +error[E0515]: cannot return reference to temporary value --> $DIR/return_from_external_macro.rs:7:13 | LL | drop(|| ret_from_ext::foo!()); | ^^^^^^^^^^^^^^^^^^^^ | | | returns a reference to data owned by the current function - | local binding introduced here + | temporary value created here | = note: this error originates in the macro `ret_from_ext::foo` (in Nightly builds, run with -Z macro-backtrace for more info) |
