discard default auto trait impls if explicit ones exist (rebase of #85048) by Dd...
source link: https://github.com/rust-lang/rust/pull/113312
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
discard default auto trait impls if explicit ones exist (rebase of #85048) #113312
Conversation
Contributor
Rebase of #85048
Collaborator
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Contributor
Author
r? @lcnr |
changed the title
auto trait candidate selection is unsound (rebase of #84857)
auto trait candidate selection is unsound (rebase of #85048)
changed the title
auto trait candidate selection is unsound (rebase of #85048)
discard default auto trait impls if explicit ones exist (rebase of #85048)
Contributor
thanks for looking into this lets start with crater @bors try |
This comment has been minimized.
Contributor
💔 Test failed - checks-actions |
added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
oh, this PR is now breaking |
Contributor
|
if !has_impl { |
||
candidates.vec.push(AutoImplCandidate) |
||
} |
||
} |
Contributor
ah, this is wrong for opaque types we need to always emit consider AutoImplCandidate
s for them if they don't also have a ProjectionCandidate
. This is a bit of a mess in the old solver.
The issue is that we consider all impls to potentially apply for opaque types, but we should instead actually leak their underlying type and check whether it implements the auto trait
cc @compiler-errors given that we've recently talked about auto traits and opaques :>
Contributor
@bors try |
Contributor
Try build successful - checks-actions |
Contributor
@craterbot check |
Collaborator
Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
added S-waiting-on-crater Status: Waiting on a crater run to be completed.
and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
labels
added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.
and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
labels
This is now entering its final comment period, as per the review above. 🔔 |
added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting
and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.
labels
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Contributor
can you change the description of r=me after that |
Contributor
@Ddystopia, you can now approve this pull request! If @lcnr told you to " |
Contributor
Author
added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
labels
Contributor
Test successful - checks-actions |
Member
There's an empty file, |
struct Foo<T, U>(Always<T, U>); |
||
trait False {} |
||
unsafe impl<U: False> Send for Foo<u32, U> {} |
This would be worth a comment explaining what is being tested: that the manual impl Send for Foo
should "block" the implicit impl
Contributor
Not sure how much explanation makes sense here, though a "Tests that we don't incorrectly allow overlap between a builtin auto trait impl and a user written one. See #83857 for more details." would be good here.
Contributor
@Ddystopia are you up to open a PR here? otherwise I can do it next week |
Contributor
Author
Yes, sure |
Collaborator
Finished benchmarking commit (e4c98ca): comparison URL. Overall result: regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 651.183s -> 651.8s (0.09%) |
This comment was marked as spam.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK