Skip to content

nested ref copy - #2515

Merged
ehartford merged 2 commits into
bootstrap-lib-retirefrom
nested-ref-copy
Oct 21, 2026
Merged

ehartford merged 2 commits into
bootstrap-lib-retirefrom
nested-ref-copy

Conversation

@ehartford

@ehartford ehartford commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

D139, ruled by Eric 2026-10-20 (#2220 step 2): D22 §7.4 applies at every reference layer — a view of a view of a Copy value carries no information beyond the value, so &&i64 meets an owned i64 demand by reading through both layers. The two older compile-error fixtures that said otherwise lose (they encoded behavior no ruling made; recorded principle: a later ruling that contradicts such a test wins): rr == 42 with rr: &&i32 compiles and compares values; take_i32(&first) with first: &i32 compiles with a new redundant-& warning. Edges, each with a fixture: reads of Copy values only (a view of a view of a Drop type still does not materialize, err_d139_nested_view_of_non_copy_does_not_materialize.w); generics agree (== on a T instantiated with &i32 compares values, in behav_d139_nested_view_reads.w, which also covers filter(it % 2 == 1) over a view iterator with no *it). Decision record docs/meetings/2026-10-20-D139-…, spec §3 sentence. Gate green (190 s). Layer 4 of stack #2516.

… layer (D139, #2220 step 2)

D22 section 7.4 applies per reference layer: a view is Copy, so `&&i64` reads
through both layers where an i64 is demanded, as `&&str` already did (D111).
The one-layer cap on non-str pointees in contextual_copy_value_type is
removed. A list iterator that yields `&T` hands a filter predicate `&&i64`;
`filter(it % 2 == 1)` compiles. Delegated under D98; spec section 3 carries
the sentence; fixture fails on the installed compiler.
…&` on a view warns

Eric (2026-10-20): every layer; the two older compile-error fixtures lose
(they encoded behavior no ruling made, and a later ruling that contradicts
such a test wins -- recorded with D139). `rr == 42` with `rr: &&i32`
compiles and compares values; `take_i32(&first)` with `first: &i32`
compiles with a redundant-`&` warning. Edges: reads of Copy values only (a
view of a view of a Drop type still does not materialize: fixture);
generics agree (`==` on a T instantiated with `&i32` compares values:
fixture). filter over a view iterator takes its predicate without `*it`.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on the stack's top commit 10e81d0 (conan-retry worktree, seed nightly-20261020-local-3): gate, uat and battery-checks green. Three earlier runs were red on UAT only, each a resolver or download stall on this laptop's network (#2517 carries the evidence); every other target was green in all four runs.

@ehartford
ehartford marked this pull request as ready for review October 21, 2026 06:52
@ehartford
ehartford merged commit 7eebb29 into main Oct 21, 2026
@ehartford
ehartford deleted the nested-ref-copy branch October 21, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant