mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix misleading Lifetime diagnostics for inout parameters
Correctly diagnose this as:
"invalid use of inout dependence on the same inout parameter
@_lifetime(a: &a)
func f_inout_useless(a: inout MutableRawSpan) {}
Correctly diagnose this as:
"lifetime-dependent parameter must be 'inout'":
@_lifetime(a: borrow a)
func f_inout_useless(a: borrowing MutableRawSpan) {}
(cherry picked from commit 05fa82b7a7)
This commit is contained in:
@@ -8244,7 +8244,7 @@ ERROR(lifetime_dependence_cannot_use_default_escapable_consuming, none,
|
||||
"invalid lifetime dependence on an Escapable value with %0 ownership",
|
||||
(StringRef))
|
||||
ERROR(lifetime_dependence_cannot_use_parsed_borrow_inout, none,
|
||||
"invalid use of borrow dependence on the same inout parameter",
|
||||
"invalid use of inout dependence on the same inout parameter",
|
||||
())
|
||||
ERROR(lifetime_dependence_duplicate_target, none,
|
||||
"invalid duplicate target lifetime dependencies on function", ())
|
||||
|
||||
Reference in New Issue
Block a user