Engineering
Rust 1.100.1 Internals: How an Unstable const Iterator Bound Broke Stable Builds—and How PR #166340 Fixed It
On November 27, 2026, the Rust team shipped Rust 1.100.1 to fix a subtle trait-solver regression introduced in Rust 1.100.0. An unstable [const] Destruct bound on Iterator::nth and DoubleEndedIterator::nth_back leaked into stable impl checking via incomplete ParamEnv normalization, breaking objc2 0.4.1, winit, and glutin.
8 min read
Rust 1.100.1 Internals: How an Unstable const Iterator Bound Broke Stable Builds—and How PR #166340 Fixed It
Executive Summary
On November 27, 2026, the Rust Release Team published Rust 1.100.1, a targeted point release resolving a compiler regression introduced two weeks earlier in Rust 1.100.0 (November 12, 2026). The regression prevented valid, purely stable Iterator and DoubleEndedIterator implementations from compiling—throwing E0277 errors on nth() and nth_back()—even though the offending change belonged to an unstable const version of Iterator that stable Rust code cannot even call.
Reported in rust-lang/rust issue #166229 on November 20, 2026 and resolved in just seven days via PR #166340 (merged November 24, released November 27), the incident offers a textbook systems-engineering case study on why feature gates do not automatically isolate shared compiler machinery:
- Blast radius:
objc20.4.1(used for Rust-to-Objective-C interoperability on macOS and iOS) failed to compile on Rust 1.100.0, cascading into GUI crates such aswinit,glutin, andeframe, as documented by Linux Compatible. - Root cause: Adding a
[const] Destructwhere-clause bound onIterator::nthandDoubleEndedIterator::nth_back(via PR#156216, merged September 16, 2026) exposed an incomplete two-stepParamEnvnormalization path in Rust's hybrid trait solver when checking associated types derived throughDeref::Target. - Resolution: Rather than rushing a risky trait-solver overhaul mid-cycle, the Rust team reverted the unstable
constbound in1.100.1, restoring 100% compatibility for existing codebases without requiring crate-level workarounds.
Confidence Level: High. The release timeline, exact PR/issue numbers (#156216, #166229, #166340), affected crates (objc2 0.4.1, winit, glutin, eframe), and root-cause explanation are verified across the primary Rust Blog announcement, GitHub release notes, Linux Compatible, and Skill Stuff's compiler analysis.
The Bottleneck & Failure Constraints: Why Feature Gates Didn't Isolate It
Rust 1.100.0 (November 12, 2026) was one of the largest releases in the language's history: after a decade of design and five prior attempts, it stabilized the ! (never) type, aliased core::convert::Infallible to !, stabilized custom allocators (Box::new_in, Vec::from_fn, std::alloc::Allocator), and added Cargo dependency cooldowns for supply-chain defense. Yet the regression that forced 1.100.1 came from a feature stable users couldn't even turn on.
How a Nightly-Only const Bound Broke Stable Deref Wrappers
To support evaluating range iterators at compile time (const), PR #156216 (merged September 16, 2026) removed #[rustc_non_const_trait_method] from Iterator::nth and DoubleEndedIterator::nth_back and attached a where-clause bound requiring Self::Item: [const] Destruct. Why does nth(n) need Destruct while next() does not? Calling nth(n) advances past n preceding elements and discards them before returning the target item. If those discarded items have custom drop logic, nth() invokes their destructors. At runtime, that is ordinary Rust behavior; during compile-time const evaluation, const_destruct requires proving that discarding those items is valid in a constant context.
Even though stable Rust rejects const trait calls, there is only one Iterator trait definition in core. From a software architecture perspective, a feature gate works like an API flag protecting public user-facing endpoints while a shared database schema or validation state machine changes underneath. The feature gate establishes a boundary around permitted user syntax, not an isolated reasoning environment inside rustc. Every stable impl Iterator still runs through the exact same trait-checking, associated-type resolution, and method-compatibility machinery.
Consider a minimal wrapper pattern representative of the reduced reproduction in issue #166229, where a generic type implements Iterator indirectly through Deref::Target:
use std::ops::Deref;
struct Wrapper<T>(T);
impl<T> Iterator for Wrapper<T>
where
T: Deref,
T::Target: Iterator,
{
type Item = <T::Target as Iterator>::Item;
fn next(&mut self) -> Option<Self::Item> {
None
}
fn nth(&mut self, _n: usize) -> Option<Self::Item> {
None
}
}
Crucially, the failure exhibited two telling symptoms:
next()andnext_back()compiled;nth()andnth_back()failed: Even whennth()'s body was stripped down to simply returningNone—requiring zero iterator advancement or Objective-C FFI logic—rustcrejected the method's type signature withE0277, claiming the type did not satisfyIterator.- Indirect associated-type projections triggered it: Generic wrappers implementing
Iteratorvia aDeref::Targetbound—where the compiler must first resolveT::Targetand then normalize<T::Target as Iterator>::Item—hit the failure first, notably insideobjc2 0.4.1.
Inside the Solution: ParamEnv Normalization & Trait-Solver Internals
Why did adding a where-clause bound to nth() make rustc forget that a type already implemented Iterator? As Rust contributor lcnr identified in the November 23 discussion of issue #166229, the fault lay in parameter-environment (ParamEnv) normalization inside the compiler's hybrid trait solver.
The Circular Dependency in ParamEnv Construction
When rustc type-checks a trait method implementation, it combines two sets of assumptions into a ParamEnv:
- The implementation's own
whereclauses (e.g.,Wrapper<T>: DerefwhereT::Target: Iterator). - The trait method's
whereclauses (including the newly addedSelf::Item: [const] Destruct).
flowchart TD
A["impl Iterator for Wrapper<T><br/>(Deref::Target = T)"] --> B["Combine Impl Predicates +<br/>Method Predicates ([const] Destruct)"]
B --> C{"Single-Pass ParamEnv<br/>Normalization"}
C -- "1.100.0 (Bug)" --> D["Fails to Normalize Associated Type<br/>Self::Item Before Obligation Check"]
D --> E["Throws E0277 on nth() / nth_back()<br/>(next() Unaffected)"]
C -- "1.100.1 (PR #166340)" --> F["Reverts Unstable const Bound on nth()"]
F --> G["Valid Iterator Impls Resolve Cleanly"]Proving trait obligations and normalizing associated types (such as <Wrapper<T> as Iterator>::Item) creates a delicate dependency: the solver needs a constructed ParamEnv to normalize projections, and it needs normalized projections inside the ParamEnv to prove subsequent bounds. Without two-step normalization—first normalizing the implementation's existing constraints against the unnormalized impl environment, and then normalizing the combined method-level ParamEnv—the extra [const] Destruct bound disrupted the solver's proof search. Specifically, when Wrapper<T> projects Self::Item as <T::Target as Iterator>::Item, the solver must resolve T::Target before checking whether Self::Item satisfies [const] Destruct. Because the unnormalized ParamEnv lacked that intermediate projection step, rustc failed to prove an Iterator obligation that was already logically present in the program.
Using cargo-bisect-rustc, contributors narrowed the failure to the September 17, 2026 nightly (the build immediately following PR #156216's merge on September 16), confirming that the regression had lain dormant for nearly two months before Rust 1.100.0 promoted that code to stable.
Notice also why this was not a soundness bug or miscompilation: rustc never emitted invalid machine code or bypassed memory safety. Instead, it was a completeness regression—rejecting valid, previously accepted programs with misleading E0277 diagnostics suggesting developers add redundant trait bounds to code whose constraints were already logically sufficient.
Post-Mortem Lessons & Patch Timeline
From initial bug report to shipped point release, the Rust team closed the loop in 7 days (including a weekend):
| Milestone | Date (2026) | Technical / Ecosystem Event |
|---|---|---|
PR #156216 Merged |
Sept 16, 2026 | Added [const] Destruct bound to Iterator::nth / nth_back on nightly |
Rust 1.100.0 Shipped |
Nov 12, 2026 | Stabilized ! type & allocators; shipped PR #156216 change in core |
Issue #166229 Opened |
Nov 20, 2026 | Reported objc2 0.4.1 breakage (winit, glutin, eframe on macOS/iOS) |
| Root Cause Identified | Nov 23, 2026 | lcnr pinpointed incomplete ParamEnv normalization in hybrid solver |
PR #166340 Merged |
Nov 24, 2026 | @clarfonthey reverted the unstable const bound on Iterator::nth |
Rust 1.100.1 Released |
Nov 27, 2026 | Point release published on stable channel |
Two institutional lessons stood out in the issue discussion:
- Repeat regression without a dedicated test: As
@RalfJungnoted in issue#166229,objc2had tripped over a nearly identicalnthbound in 2023 due to the same incompleteParamEnvnormalization, yet no regression test had been added for that exactDeref-projection pattern. - Pragmatic revert over risky solver surgery: While Rust is actively migrating toward its "next-generation trait solver" (
trait-system-refactor-initiative), landing a two-stepParamEnvnormalization fix in a point release carried high risk of subtle side effects across other generic code. Reverting the unstableconstbound bought safe runway for the next solver without holding stable users hostage.
Practical Takeaways for Your Stack
Even if you don't write Rust for macOS, the 1.100.1 incident provides a concrete playbook for managing compiler and toolchain upgrades in production:
- Upgrade straight from
1.100.0to1.100.1: If your CI hitE0277onIterator::nthornth_backafter November 12, update your toolchain and remove any temporaryrustc1.99.0pins or workaround trait bounds:
rustup update stable
- Test platform-specific dependency graphs in CI: A Linux-only CI runner will never compile
objc2,winit, orglutinmacOS/iOS targets. Always include cross-platform check jobs (cargo check --target aarch64-apple-darwin) when validating new compiler releases. - Bisect the toolchain before rewriting generic bounds: When previously valid code fails with an
E0277after a toolchain bump, test the prior compiler version or usecargo-bisect-rustcbefore refactoring complex trait bounds—the proof engine itself may be at fault. - Audit Rust
1.100.xbreaking changes separately: Remember that Rust1.100.0intentionally introduced the!never-type fallback change (shifting from()to!on older editions), tighter ARM/x86 ABI rules, andno_mangle_generic_itemsbecoming a hard error; review the official release notes if you are jumping from1.99.xor earlier.
Frequently Asked Questions
What did Rust 1.100.1 fix?
Released on November 27, 2026, Rust 1.100.1 reverted an unstable const Iterator change (from PR #156216) that prevented some types with valid Iterator and DoubleEndedIterator implementations—particularly via Deref::Target bounds—from compiling on Rust 1.100.0.
Why did an unstable const feature break stable Rust code?
Although stable Rust cannot call const trait methods, core::iter::Iterator shares a single trait definition across stable and nightly. Adding [const] Destruct to nth() and nth_back() altered the trait's method predicates, which interacted with incomplete ParamEnv normalization during normal impl checking.
Which crates and platforms were most affected?
objc2 version 0.4.1 failed to compile on Rust 1.100.0, breaking downstream Apple-targeted GUI crates including winit, glutin, and eframe on macOS and iOS builds. Projects pinned to objc2 below 0.5 compile cleanly again on 1.100.1.
Was Rust 1.100.0 a memory-safety bug or miscompilation?
No. There were no reports of silent miscompilation or memory-safety bypasses. It was a compiler completeness regression where rustc rejected valid programs with E0277 errors during trait obligation checking.
How can developers isolate similar compiler regressions in the future?
Compare compilation directly against the previous stable release (1.99.0 vs 1.100.0) before altering application trait bounds, and use cargo-bisect-rustc to pinpoint the exact nightly PR that introduced the regression.
Sources
- The Rust Release Team — Announcing Rust 1.100.1, Rust Blog, November 27, 2026: https://blog.rust-lang.org/2026/11/27/Rust-1.100.1/
- Rust GitHub Releases — rust-lang/rust Releases (1.100.0 & 1.100.1 notes), November 2026: https://github.com/rust-lang/rust/releases
- Linux Compatible (Philipp Esselbach) — Rust 1.100.1 Released: Patch Fixes Iterator Regression That Broke Apple Dev Tools, November 28, 2026: https://www.linuxcompatible.org/story/rust-11001-released-patch-fixes-iterator-regression-that-broke-apple-dev-tools/
- Skill Stuff — Rust Changed an Unstable Feature. Why Did It Break Code That Was Already Valid?, November 28, 2026: https://medium.com/skillstuff/rust-changed-an-unstable-feature-why-did-it-break-code-that-was-already-valid-258f98c2a251