Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore impls with #[rustc_reservation_impl] #14750

Merged
merged 1 commit into from
May 6, 2023

Conversation

lowr
Copy link
Contributor

@lowr lowr commented May 6, 2023

Fixes #12247
Fixes #14279

Currently core has two blanket impls for From: impl<T> From<T> for T and impl<T> From<!> for T. These are conflicting and thus chalk cannot uniquely solve S: From<?0> for any type S.

The latter impl is actually a reservation impl and should not be considered during trait selection. More generally, impls attributed with perma-unstable #[rustc_reservation_impl] attribute should be disregarded except for coherence checks. See rust-lang/rust#64631 and rust-lang/rust#64715 for details.

I chose to entirely ignore them in hir-ty because we don't do coherence checks.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2023
@HKalbasi
Copy link
Member

HKalbasi commented May 6, 2023

@bors r+

@bors
Copy link
Contributor

bors commented May 6, 2023

📌 Commit 9360adc has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 6, 2023

⌛ Testing commit 9360adc with merge bb66f6f...

@bors
Copy link
Contributor

bors commented May 6, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing bb66f6f to master...

@bors bors merged commit bb66f6f into rust-lang:master May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to find unique implementation of From fully qualified call required to determine trait method type
4 participants