Skip to content

account for impl-restricted traits in coherence - #163280

Draft
amirHdev wants to merge 2 commits into
rust-lang:mainfrom
amirHdev:impl-restriction-negative-coherence
Draft

amirHdev wants to merge 2 commits into
rust-lang:mainfrom
amirHdev:impl-restriction-negative-coherence

Conversation

@amirHdev

@amirHdev amirHdev commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

the original change broke aho-corasick because of SliceIndex
made future upstream impls opt-in with #[rustc_coherence_future_impls] which VaArgSafe now use

https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/Impl.20restriction.20sadness/with/626411732

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 24, 2026
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Sep 26, 2026
@jhpratt

jhpratt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Overall, this seems to be well-implemented. If it is accepted, there would need to be better diagnostics for this type of of situation. The name of the attribute itself is also not clear imo. I feel obliged to mention that I am not a compiler reviewer and have only acted in an advisory role reviewing restriction PRs.

But to repeat what I said on Zulip, I'm not sure this is the right way to go. It would implicitly mean that it wouldn't be permitted to remove the impl restriction anywhere the attribute is present.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants