-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Refactoring to OpaqueTyOrigin
#131183
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy HIR ty lowering was modified cc @fmease |
Hold up not ready yet @rustbot author |
ecbd707
to
7cd466a
Compare
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
ok, I think it's ready @rustbot ready |
@bors r+ |
…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
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 wtf lol |
…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`
…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 😄
…rrowck, r=estebank 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`
…rrowck, r=estebank 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`
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 😄