diff --git a/compiler/src/dmd/escape.d b/compiler/src/dmd/escape.d index d7a1f0e76c3..947abf0c4bc 100644 --- a/compiler/src/dmd/escape.d +++ b/compiler/src/dmd/escape.d @@ -1010,7 +1010,7 @@ bool checkNewEscape(ref Scope sc, Expression e, bool gag) { const(char)* msg = v.isParameter() ? "escaping a reference to parameter `%s` by copying `%s` into allocated memory" : - "escaping a reference to local variable `%s by copying `%s` into allocated memory"; + "escaping a reference to local variable `%s` by copying `%s` into allocated memory"; return setUnsafePreview(&sc, fs, gag, e.loc, msg, v, e); } diff --git a/compiler/test/fail_compilation/retscope2.d b/compiler/test/fail_compilation/retscope2.d index 8e10a7caae7..4638cdc139a 100644 --- a/compiler/test/fail_compilation/retscope2.d +++ b/compiler/test/fail_compilation/retscope2.d @@ -296,7 +296,7 @@ fail_compilation/retscope2.d(1024): Error: assigning scope variable `p` to non-s fail_compilation/retscope2.d(1107): Error: returning scope variable `dg` is not allowed in a `@safe` function fail_compilation/retscope2.d(1216): Error: returning `s.foo()` escapes a reference to local variable `s` fail_compilation/retscope2.d(1233): Error: returning `t.foo()` escapes a reference to local variable `t` -fail_compilation/retscope2.d(1306): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/retscope2.d(1306): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function --- */ diff --git a/compiler/test/fail_compilation/retscope3.d b/compiler/test/fail_compilation/retscope3.d index 59bf11b6268..819071f15d0 100644 --- a/compiler/test/fail_compilation/retscope3.d +++ b/compiler/test/fail_compilation/retscope3.d @@ -51,8 +51,8 @@ void bar4() /* TEST_OUTPUT: --- -fail_compilation/retscope3.d(2008): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function -fail_compilation/retscope3.d(2017): Error: escaping a reference to local variable `i by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function +fail_compilation/retscope3.d(2008): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/retscope3.d(2017): Error: escaping a reference to local variable `i` by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function fail_compilation/retscope3.d(4003): Error: escaping a reference to parameter `u` by copying `u[]` into allocated memory is not allowed in a `@safe` function fail_compilation/retscope3.d(4016): Error: storing reference to outer local variable `i` into allocated memory causes it to escape fail_compilation/retscope3.d(4025): Error: escaping reference to stack allocated value returned by `makeSA()` into allocated memory diff --git a/compiler/test/fail_compilation/retscope6.d b/compiler/test/fail_compilation/retscope6.d index 49751a4b339..e3b734f03d4 100644 --- a/compiler/test/fail_compilation/retscope6.d +++ b/compiler/test/fail_compilation/retscope6.d @@ -5,7 +5,7 @@ REQUIRED_ARGS: -preview=dip1000 /* TEST_OUTPUT: --- -fail_compilation/retscope6.d(6007): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/retscope6.d(6007): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function --- */ diff --git a/compiler/test/fail_compilation/test18282.d b/compiler/test/fail_compilation/test18282.d index 97b2b2b1333..b5db07fd938 100644 --- a/compiler/test/fail_compilation/test18282.d +++ b/compiler/test/fail_compilation/test18282.d @@ -2,12 +2,12 @@ TEST_OUTPUT: --- fail_compilation/test18282.d(25): Error: returning scope variable `aa` is not allowed in a `@safe` function -fail_compilation/test18282.d(34): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function -fail_compilation/test18282.d(35): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(34): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(35): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function fail_compilation/test18282.d(36): Error: returning scope variable `staa` is not allowed in a `@safe` function -fail_compilation/test18282.d(44): Error: escaping a reference to local variable `i by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function -fail_compilation/test18282.d(53): Error: escaping a reference to local variable `i by copying `& i` into allocated memory is not allowed in a `@safe` function -fail_compilation/test18282.d(53): Error: escaping a reference to local variable `c by copying `& c` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(44): Error: escaping a reference to local variable `i` by copying `S2000(& i)` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(53): Error: escaping a reference to local variable `i` by copying `& i` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(53): Error: escaping a reference to local variable `c` by copying `& c` into allocated memory is not allowed in a `@safe` function --- */ @@ -57,9 +57,9 @@ void bar3() /****************************** TEST_OUTPUT: --- -fail_compilation/test18282.d(1007): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function -fail_compilation/test18282.d(1008): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function -fail_compilation/test18282.d(1009): Error: escaping a reference to local variable `foo by copying `& foo` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(1007): Error: escaping a reference to local variable `foo` by copying `& foo` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(1008): Error: escaping a reference to local variable `foo` by copying `& foo` into allocated memory is not allowed in a `@safe` function +fail_compilation/test18282.d(1009): Error: escaping a reference to local variable `foo` by copying `& foo` into allocated memory is not allowed in a `@safe` function fail_compilation/test18282.d(1016): Error: escaping a reference to parameter `this` by copying `&this` into allocated memory is not allowed in a `@safe` function --- */