Fix three constructor-discovery ICEs from the crates.io sweep - #4725
Merged
Conversation
feliperodri
marked this pull request as ready for review
August 25, 2026 21:06
Surfaced by a top-500 crates.io autoharness sweep (12 crates affected): 1. Items with their own early-bound lifetimes (AtomicU8::from_ptr<'a>) were resolved with the ADT args only, panicking on the arity mismatch (brotli, sharded-slab). 2. Lifetime-parameterized impls place lifetimes anywhere in the generics order (impl<'h> Searcher<'h> in regex-automata; also gimli, redox_syscall, arc-swap, clap_builder, event-listener, crypto-bigint), so appending erased lifetimes is not enough: build the argument list positionally against the item's full parent+own generics, rejecting the constructor when counts or kinds do not fit (rustc's instantiation panics on kind mismatches rather than returning Err). 3. Constructor arguments carrying escaping late-bound regions inside ADTs (BorrowedFd<'_> in async-io, js-sys, quinn-udp, wasm-bindgen) panicked the trait solver's dummy-binder wrap; such arguments are not generatable, so reject the candidate up front. The constructor regression test gains all three shapes. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
feliperodri
force-pushed
the
ctor-pr-fixes
branch
from
August 26, 2026 13:52
7e6ce05 to
596cf65
Compare
feliperodri
approved these changes
Aug 26, 2026
feliperodri
enabled auto-merge
August 26, 2026 14:04
Merged
via the queue into
model-checking:main
with commit Aug 26, 2026
406e7ba
33 of 34 checks passed
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.
Stacked on #4717 (
--constructor-args); only the last commit is new. Marked draft until #4717 merges.A top-500 crates.io autoharness sweep (tracking #3832) ICEd in constructor discovery on 12 crates; three root causes:
AtomicU8::from_ptr<'a>-style constructors were resolved with the ADT args only — arity mismatch panic.impl<'h> Searcher<'h>places the lifetime first, so appending erased lifetimes is insufficient — the argument list is now built positionally against the item's full parent+own generics, rejecting shape mismatches up front (rustc's instantiation panics on kind mismatches rather than returningErr).BorrowedFd<'_>-style arguments read from a skipped fn-sig binder panicked the trait solver's dummy-binder wrap; such candidates are rejected as non-generatable.All 12 crates verified clean with this branch. The constructor regression test gains all three shapes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.