Repository navigation
emit: §3 single-authority for variant-import detection (dedup direct-vs-variant use, −15 E0252) - #5562
Merged
Conversation
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.
What
Extracts the 4-rung variant-parent resolution (same-module decl → reexport surface → imported-enum scope → import-module-enum scope) into one helper
import_variant_parent_for_name, used by both the variant-emission set (all_parents→parent_list) and the direct-import exclusion (non_variant_top).Why (§3 single authority)
The direct-import filter used a weaker variant-detection authority (
is_known_variantovertype_summaries) than the variant-line emitter (find_variant_parent_in_moduleovertyped_modules). They disagreed on cross-module / reexported variants, so a name likeFile(aUriSchemevariant) was emitted both as a directpub use crate::extdeps_uri::{File}and a variantuse crate::extdeps_uri::UriScheme::{File}→ E0252 reimport. One authority now decides, so a name can never appear in both forms.Verified by execution (faithful v2+dsl census)
File/Https/Ftpdirect-vs-variant collisions are gone (confirmed in emittedextdeps_external_authority.rs).v1-compiler-testssuite (run-all gate parity, post-Widen the rust gate by construction (§1): invert the hand-picked 3-filter allowlist (29 of 792 green tests) → run-all-unless-#[ignore]d-with-written-reason; add CI-coverage-completeness so a new test is covered by default (fail-closed); measure CI-time impact before committing the full set #5427): 765 passed, 0 failed, 92 ignored.#![allow(clippy::all)].Scope / out-of-scope
The remaining ~428 E0252 are a different root —
emit_prelude()injectsuse crate::v1_rt::Witnessinto all modules while v2 std now definesWitness(E0255 redefinition + reimport cascade). That is the v1_rt-runtime-vs-std primitive-authority decision, routed to the value-grounding lane (stern-bat-782), not import hygiene. Region-local edit (import-emission ~2655); coordinated with the value-construct lane (~4693-5886).Seed mirror (
v1_compiler_emit_rust.rs) hand-synced to the.dagauthority per current bootstrap protocol (regen --verifydeferred, #5514).