Skip to content

Integrate trait impls into template specialization logic.#766

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_890047063
Open

Integrate trait impls into template specialization logic.#766
copybara-service[bot] wants to merge 1 commit intomainfrom
test_890047063

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service bot commented Mar 26, 2026

Integrate trait impls into template specialization logic.

Trait impls predate the logic around emitting template specializations,
and so had special case logic to emit in the right location. Now that we
have actual logic for placing template specializations correctly in
bindings, we don't need the special case logic.

This revealed an issue around template specialization where trait impls
can, understandably, produce specializations of Result/Option. I
think a simpler hiearchy of handle trait impls -> handle result/option specializations would suffice, but I opted to use a
fixpoint of specializations instead so that such issues do not continue
to arise in the future. It is absolutely debatable if this is warranted.

@copybara-service copybara-service bot force-pushed the test_890047063 branch 3 times, most recently from c06f00f to 7a5335b Compare March 27, 2026 20:50
Trait impls predate the logic around emitting template specializations,
and so had special case logic to emit in the right location. Now that we
have actual logic for placing template specializations correctly in
bindings, we don't need the special case logic.

This revealed an issue around template specialization where trait impls
can, understandably, produce specializations of `Result`/`Option`. I
think a simpler hiearchy of `handle trait impls` -> `handle
result/option specializations` would suffice, but I opted to use a
fixpoint of specializations instead so that such issues do not continue
to arise in the future. It is absolutely debatable if this is warranted.

PiperOrigin-RevId: 890047063
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