Repository navigation
Simplify effect args and providers - #1999
Merged
sbillig merged 8 commits intoNov 15, 2026
Merged
Conversation
An effect arg is always a place, so the arg variant, `with_source` and the pass mode said one thing three ways. `EffectArg` is now a `with` value or the caller's own effect binding, and the lowering takes the place or temporary its `with` block captured. `EffectEvidence` is one struct: a type key's evidence carries the type it is provided as. This removes the pass-mode guard on unkeyed type providers and the unreachable arms that went with it.
`EffectOrigin::Param` held an effect's site and index beside `ProvidedEffect.binding`, an `Option` that was always `Some` for it with the same site and index. The origin now holds the binding, and a `with` value's origin the binding it names. An effect binding always gives an effect arg and a provenance, so the missing-effect fallback and the provenance panic go.
An effect barrier carried a reason with a span and the `with` key's path. Lookups passed the reason along and dropped it; only the path was read, where the barrier is inserted. A barrier is now its pattern, and the insertion takes the path.
`Stored` was never constructed, and `Solver` and `Compare` took the same branch, which is `normalize_effect_identity_ty` and `normalize_effect_identity_trait`. Use those.
`EffectCommitPlan.extra_unifications` was always empty. A keyed type witness probed the key match, rolled it back, then applied it again to specialize the key, with the same error on either failure; the specialization alone decides it now.
`ProviderSemantics.address_space` was always `Some`: `provider_semantics` sets memory and every other constructor sets a space. Store an `AddressSpace` and remove the fallbacks, the missing-space panic in MIR and `NormalizeError::MissingProviderAddressSpace`. The provider identity prints the space without `Some`, which changes symbol hashes and function order in three Sonatina IR snapshots.
`runtime_class_for_effect_binding_provider_in_env` returned `Some` on every path, `runtime_class_for_direct_value_provider_in_env` was an alias of it, and callers chained one after the other and panicked on `None`. Replace both and `runtime_class_for_provider_binding` with `runtime_class_for_provider`, which returns the class. Merge the two root-provider arms of `runtime_effect_binding_plan`.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes effect arg and provider representations that have one reachable state since #1994–#1996. No behaviour change.
EffectArgis awithvalue or the caller's own effect binding.with_sourceandEffectPassModeare removed, andEffectEvidenceis one struct.EffectOrigin::Paramholds the effect binding in place of a copy of its site and index. The missing-effect fallback and the provenance panic are removed.BarrierReason. Only its path was read, where the barrier is inserted.EffectKeyCanonMode.Storedwas never constructed, andSolverandComparetook the same branch.EffectCommitPlan.extra_unifications, which was always empty, and the probe and rollback before a keyed type witness specializes its key.ProviderSemantics.address_spaceis anAddressSpace, not anOption.NormalizeError::MissingProviderAddressSpaceand the missing-space panic in MIR are removed.runtime_class_for_providerreplaces three functions that returnedOptionand neverNone.effect_argsof extern builtin calls.Three Sonatina IR snapshots change symbol hashes and function order: the provider identity prints its space without
Some.