diff options
| author | Stephen Crane <sjc@immunant.com> | 2019-09-25 11:45:38 -0700 |
|---|---|---|
| committer | Stephen Crane <sjc@immunant.com> | 2019-09-25 17:45:15 -0700 |
| commit | 0ec4513d5fe23fabe353e4773682ddb341c9d20f (patch) | |
| tree | eadfee784797a1ef47e4db0f3397260355d4a368 /src/test | |
| parent | 6c2c29c43206d6e2f1091fa278d2792ea10e3659 (diff) | |
| download | rust-0ec4513d5fe23fabe353e4773682ddb341c9d20f.tar.gz rust-0ec4513d5fe23fabe353e4773682ddb341c9d20f.zip | |
Fix format macro expansions spans to be macro-generated
New Exprs generated as part of the format macro expansion should get the macro expansion span which has an expansion context, not the span of the format string which does not.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/issues/issue-27592.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-27592.stderr | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/test/ui/issues/issue-27592.rs b/src/test/ui/issues/issue-27592.rs index b023ea18ac9..88f70f58402 100644 --- a/src/test/ui/issues/issue-27592.rs +++ b/src/test/ui/issues/issue-27592.rs @@ -15,5 +15,5 @@ impl ::std::fmt::Write for Stream { fn main() { write(|| format_args!("{}", String::from("Hello world"))); //~^ ERROR cannot return value referencing temporary value - //~| ERROR cannot return value referencing temporary value + //~| ERROR cannot return reference to temporary value } diff --git a/src/test/ui/issues/issue-27592.stderr b/src/test/ui/issues/issue-27592.stderr index 9d3eaa9705d..c8649d82d74 100644 --- a/src/test/ui/issues/issue-27592.stderr +++ b/src/test/ui/issues/issue-27592.stderr @@ -7,14 +7,11 @@ LL | write(|| format_args!("{}", String::from("Hello world"))); | | temporary value created here | returns a value referencing data owned by the current function -error[E0515]: cannot return value referencing temporary value +error[E0515]: cannot return reference to temporary value --> $DIR/issue-27592.rs:16:14 | LL | write(|| format_args!("{}", String::from("Hello world"))); - | ^^^^^^^^^^^^^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | temporary value created here - | returns a value referencing data owned by the current function + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function error: aborting due to 2 previous errors |
