-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Have the spans of TAIT type conflict errors point to the actual site instead of the owning function #93818
Conversation
…instead of the owning function
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 91fa570 with merge 07de7cd7d7549d7e3c9cd9dec398a2e0cc1f1964... |
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 ok with the changes as they are (it can be r=me contingent on perf), but I would love follow up work to extend the concrete type differs
error to have spans pointing at the TAIT definition and potentially the signature of the enclosing item.
@@ -609,7 +610,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> { | |||
// ``` | |||
let tables = self.tcx.typeck(def_id); | |||
if let Some(_) = tables.tainted_by_errors { | |||
self.found = Some((DUMMY_SP, self.tcx.ty_error())); | |||
self.found = Some(ty::OpaqueHiddenType { span: DUMMY_SP, ty: self.tcx.ty_error() }); |
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 hope we correctly silence these 😅
I was about to tell you off for the DUMMY_SP
but that's of course preexisting 😊
--> $DIR/issue-86465.rs:6:5 | ||
| | ||
LL | fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'a u32`, got `&'b u32` | ||
LL | (a, a) | ||
| ^^^^^^ expected `&'a u32`, got `&'b u32` | ||
| | ||
note: previous use here | ||
--> $DIR/issue-86465.rs:5:1 | ||
--> $DIR/issue-86465.rs:6:5 | ||
| | ||
LL | fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | (a, a) | ||
| ^^^^^^ |
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.
Shame that we don't provide more info here to help people understand what's going on.
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.
Maybe we could special case if prev and the primary spans are the same? 🤷♀️
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 hope I can figure out how to point to the individual tuple fields at some point, but yea, maybe special casing for equal spans is the best for now
@rust-timer build 07de7cd7d7549d7e3c9cd9dec398a2e0cc1f1964 |
Queued 07de7cd7d7549d7e3c9cd9dec398a2e0cc1f1964 with parent b7cd0f7, future comparison URL. |
Finished benchmarking commit (07de7cd7d7549d7e3c9cd9dec398a2e0cc1f1964): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
@bors r=estebank |
📌 Commit dd7a93d has been approved by |
@bors r- I'll revert the original PR, so leaving this one unmerged makes that easier |
☔ The latest upstream changes (presumably #93893) made this pull request unmergeable. Please resolve the merge conflicts. |
closing in favour of doing this in the upcoming lazy TAIT PR attempt number 2 |
This means we now end up with spans in the query result of
borrowck
, but that is unavoidable (and there are already some in there, so it isn't too bad).