Files
Allan Shortlidge c1939db85d Sema: Let rethrows functions call their consuming parameters.
Rethrows checking only recognized a parameter that's referenced directly, but a
reference to a `consuming` parameter goes through a load expression since the
parameter is mutable. `@once` and `@callable(once)` parameters are implicitly
`consuming` and as a result a `rethrows` function couldn't call or forward such
a parameter without being diagnosed as throwing an error that didn't come from
the parameter.

Look through loads of a function-typed parameter during effects checking. Also
look through explicit `consume` and `copy` expressions since they also return
their value directly. Only treat a call of a `consuming` parameter as
rethrowing if the body only ever reads it, since any other use might replace
the closure with a different one and violate rethrows semantics.

Resolves rdar://190772877.
2026-10-26 22:16:26 -07:00
..