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

Refactoring to OpaqueTyOrigin #131183

Merged
merged 4 commits into from
Oct 4, 2024
Merged

Conversation

compiler-errors
Copy link
Member

Pulled out of a larger PR that uses these changes to do cross-crate encoding of opaque origin, so we can use them for edition 2024 migrations. These changes should be self-explanatory on their own, tho 😄

@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

HIR ty lowering was modified

cc @fmease

@compiler-errors
Copy link
Member Author

Hold up not ready yet

@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 Oct 3, 2024
@@ -105,7 +105,7 @@ fn future_trait_ref<'tcx>(
cx: &LateContext<'tcx>,
ty: &'tcx Ty<'tcx>,
) -> Option<(&'tcx TraitRef<'tcx>, Vec<LifetimeName>)> {
if let TyKind::OpaqueDef(item_id, bounds, false) = ty.kind
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only change to semantics in clippy, but I don't think we need to explicitly opt out AFIT here.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is doing anything right now. We don't have tests for traits for this lint. I added one and changing false->_ in the current implementation doesn't change the behavior there. So removing this should be fine 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for checking! ❤️

@@ -636,8 +636,7 @@ impl<'tcx> EmbargoVisitor<'tcx> {
impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> {
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
if self.impl_trait_pass
&& let hir::ItemKind::OpaqueTy(opaque) = item.kind
&& !opaque.in_trait
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why we were opting out in_trait from the embargo visitor, but I didn't see any change to behavior here.

@compiler-errors
Copy link
Member Author

ok, I think it's ready

@rustbot ready

@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 Oct 3, 2024
@estebank
Copy link
Contributor

estebank commented Oct 3, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Oct 3, 2024

📌 Commit 6e8573c has been approved by estebank

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#131024 (Don't give method suggestions when method probe fails due to bad implementation of `Deref`)
 - rust-lang#131112 (TransmuteFrom: Gracefully handle unnormalized types and normalization errors)
 - rust-lang#131176 (.gitignore files for nix)
 - rust-lang#131183 (Refactoring to `OpaqueTyOrigin`)
 - rust-lang#131187 (Avoid ICE in coverage builds with bad `#[coverage(..)]` attributes)
 - rust-lang#131192 (Handle `rustc_query_impl` cases of `rustc::potential_query_instability` lint)
 - rust-lang#131197 (Avoid emptiness check in `PeekMut::pop`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit da81f64 into rust-lang:master Oct 4, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2024
Rollup merge of rust-lang#131183 - compiler-errors:opaque-ty-origin, r=estebank

Refactoring to `OpaqueTyOrigin`

Pulled out of a larger PR that uses these changes to do cross-crate encoding of opaque origin, so we can use them for edition 2024 migrations. These changes should be self-explanatory on their own, tho 😄
@bors
Copy link
Contributor

bors commented Oct 4, 2024

⌛ Testing commit 6e8573c with merge e1e3cac...

@compiler-errors
Copy link
Member Author

bors wtf lol

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2024
…rrowck, r=<try>

Try to point out when edition 2024 lifetime capture rules cause borrowck issues

Lifetime capture rules in 2024 are modified to capture more lifetimes, which sometimes lead to some non-local borrowck errors. This PR attempts to link these back together with a useful note pointing out the capture rule changes.

This is not a blocking concern, but I'd appreciate feedback (though, again, I'd like to stress that I don't want to block this PR on this): I'm worried about this note drowning in the sea of other diagnostics that borrowck emits. I was tempted to change the level of the note to `.span_warn` just so it would show up in a different color. Thoughts?

Fixes rust-lang#130545

Opening as a draft first since it's stacked on rust-lang#131183.
r? `@ghost`
@compiler-errors compiler-errors deleted the opaque-ty-origin branch October 4, 2024 04:45
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants