Files
rust/tests/ui/cast
Jonathan Brouwer 9d8d4be7b9 Rollup merge of #163016 - maxdexh:if-everything-is-a-reference-then-nothing-is, r=estebank
Don't claim that escaping value is a reference in diagnostics

Changes the part of the "borrowed data escapes" diagnostic that points to the local that the region came from, by removing the claim that it is a reference, as that is not generally correct.

Fixes rust-lang/rust#162890

I considered checking if the type of the escaping value is actually a reference type (and keeping the old message if so). But with the way the code is written, that would have been non-trivial to do, and of questionable value (the type is already shown in the error).
Also, IMO the new message is more "to the point", even for references.

r? compiler
2026-09-20 17:04:25 +02:00
..
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00
2025-07-10 15:44:36 +05:00
2026-01-05 15:35:01 +09:00
2025-12-23 21:13:24 +09:00
2025-12-23 21:13:24 +09:00
2026-01-05 15:35:01 +09:00
2026-01-05 15:35:01 +09:00
2025-12-23 21:13:24 +09:00
2025-12-23 21:13:24 +09:00
2025-06-06 20:52:34 +00:00
…
2026-01-21 13:44:01 +00:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00