Commit Graph

9 Commits

Author SHA1 Message Date
Michael Gottesman
59c8cff917 [borrowing] Add support for borrowing/consuming copyable types to be a noimplicitcopy type.
rdar://108383660
2023-06-06 18:12:29 -04:00
Michael Gottesman
07677c252b Revert "add and update tests for Copyable types not having ownership modifiers"
This reverts commit 87f190be20.
2023-06-06 12:37:49 -04:00
Kavon Farvardin
31aa2f77e3 polish noncopyable types diagnostic wordings
- replaces "move-only" terminology with "noncopyable"
- replaces compiler jargon like "guaranteed parameters"
  and "lvalue" with corresponding language-level notions
- simplifies diagnostics about closures.

and probably more.

rdar://109281444
2023-05-24 20:56:36 -07:00
Kavon Farvardin
32e89875e7 consuming cannot be applied to nonescaping closures
According to SE-377:

consuming cannot be applied to parameters of nonescaping closure type, which by their nature are always borrowed:

// ERROR: cannot `consume` a nonescaping closure
func foo(f: consuming () -> ()) {
}

This commit implements the error message.

rdar://108388132
2023-05-05 00:16:41 -07:00
Kavon Farvardin
87f190be20 add and update tests for Copyable types not having ownership modifiers
part of resolving rdar://108538971
2023-05-03 13:47:06 -07:00
Joe Groff
17c803724f Implement consuming and borrowing declaration-level modifiers from SE-0377.
`borrowing func`/`consuming func` control the ownership convention of `self` for
methods.
2023-03-01 11:58:59 -08:00
Joe Groff
4bb68a36cf Update for rebase 2023-02-28 11:02:16 -08:00
Joe Groff
833c25c7d0 Parser: Generalize : lookahead to disambiguate all parameter specifiers as argument labels 2023-02-28 09:16:45 -08:00
Joe Groff
704a4363d7 C++ parser: support borrowing and consuming modifiers.
And adjust contextual parameter modifier parsing in general to be more
properly contextual, so we don't have to reserve `__shared` or `__owned`,
or their successor spellings, as argument labels anymore.
2023-02-28 09:16:45 -08:00