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

Change orphan hint from "only" to "any uncovered type inside..." #128391

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

cafce25
Copy link
Contributor

@cafce25 cafce25 commented Jul 30, 2024

Fix #128390

@rustbot
Copy link
Collaborator

rustbot commented Jul 30, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @spastorino (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot 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 Jul 30, 2024
@rust-log-analyzer

This comment has been minimized.

@cafce25
Copy link
Contributor Author

cafce25 commented Jul 30, 2024

Argh, forgot the patch to the tests, will be home soon and add that.

@rustbot author

@rustbot rustbot 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 Jul 30, 2024
@cafce25
Copy link
Contributor Author

cafce25 commented Jul 30, 2024

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2024
@@ -351,7 +351,7 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current

hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait

hir_analysis_only_current_traits_label = impl doesn't use only types from inside the current crate
hir_analysis_only_current_traits_label = impl doesn't use any uncovered types from inside the current crate
Copy link
Contributor

@lcnr lcnr Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also not quite correct

the requirement is that given an impl impl<T0..TN> Trait<P1..Pn> for P0, there exists an uncovered local type at position Pi such that P0..Pi does not contain any uncovered generic parameters

impl<T> Trait<Local> for T {} also results in this error

Copy link
Contributor Author

@cafce25 cafce25 Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct of course, I didn't want to increase the verbosity too much.

What do you think of appending "before any uncovered generic type parameters". This again isn't totally bullet proof as P0 is only logically before the other Pn but is not before them in the source.

Copy link
Contributor

@lcnr lcnr Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something like:

  • "note: impl has uncovered type parameters before any local types"
  • "note: for more information see "

Copy link
Contributor Author

@cafce25 cafce25 Aug 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not so clear that "no local types" is also problematic when inverted like this. I prefer the original negated version. I do like the shortened "local type" instead of "types from inside the current crate", when we link to the reference anyways I think we can get away with it as it expands on what a "local type" is:

I'm guessing that's the link you meant to add here? Is it ok to link to a fragment of the reference?

I'll see if I can figure out how to add multi line notes (multiple notes?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutliple notes, yeah

your suggestion looks good to me

@spastorino
Copy link
Member

r? @lcnr (as you're already reviewing it), but this looks good to me with the last suggestion

@rustbot rustbot assigned lcnr and unassigned spastorino Aug 6, 2024
@@ -5,7 +5,8 @@ LL | impl<T> Remote for Pair<Cover<T>,T> { }
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `Pair` is not defined in the current crate
| impl doesn't use any uncovered types from inside the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vibe: I feel like these two lines should be notes, not labels

@lcnr
Copy link
Contributor

lcnr commented Aug 12, 2024

one nit, apart from that r=me

@lcnr
Copy link
Contributor

lcnr commented Aug 14, 2024

going through my list of active reviews today @rustbot author

@rustbot rustbot 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 Aug 14, 2024
@alex-semenyuk alex-semenyuk 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 19, 2024
@Dylan-DPC
Copy link
Member

@cafce25 any updates on this? thanks

@cafce25
Copy link
Contributor Author

cafce25 commented Sep 26, 2024

@Dylan-DPC Thanks for checking in, dropped the ball a bit here. I've tried to just convert the labels to notes, but that leads to the notes being mixed with repeats of the span which seems suboptimal so I've also moved them to the note field which seems a lot cleaner. @rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 26, 2024
@lcnr
Copy link
Contributor

lcnr commented Sep 27, 2024

@bors r+ rollup

thanks

@bors
Copy link
Contributor

bors commented Sep 27, 2024

📌 Commit b89c620 has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 Sep 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 17, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#128391 (Change orphan hint from "only" to "any uncovered type inside...")
 - rust-lang#131583 (Setting up indirect access to external data for loongarch64-linux-{musl,ohos})
 - rust-lang#131595 (rustdoc-JSON: Rename "object safe" to "dyn compatible")
 - rust-lang#131748 (cleanup canonical queries)
 - rust-lang#131798 (llvm: Tolerate propagated range metadata)
 - rust-lang#131815 (compiler: use `is_none_or` where it is clearly better)
 - rust-lang#131822 (extract `expr_assign_expected_bool_error`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 21c57f5 into rust-lang:master Oct 17, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 17, 2024
Rollup merge of rust-lang#128391 - cafce25:issue-128390, r=lcnr

Change orphan hint from "only" to "any uncovered type inside..."

Fix rust-lang#128390
@cafce25 cafce25 deleted the issue-128390 branch October 21, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
8 participants