-
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
Deduplicate more sized errors on call exprs #120293
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
error[E0277]: the type `&mut Context<'_>` may not be safely transferred across an unwind boundary | ||
--> $DIR/async-is-unwindsafe.rs:12:5 | ||
| | ||
LL | is_unwindsafe(async { | ||
| _____^^^^^^^^^^^^^_- | ||
| | | | ||
| | `&mut Context<'_>` may not be safely transferred across an unwind boundary | ||
LL | | | ||
LL | | use std::ptr::null; | ||
LL | | use std::task::{Context, RawWaker, RawWakerVTable, Waker}; | ||
... | | ||
LL | | drop(cx_ref); | ||
LL | | }); | ||
| |_____- within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}` | ||
LL | is_unwindsafe(async { | ||
| _____^_____________- | ||
| |_____| | ||
| || | ||
LL | || | ||
LL | || use std::ptr::null; | ||
LL | || use std::task::{Context, RawWaker, RawWakerVTable, Waker}; | ||
... || | ||
LL | || drop(cx_ref); | ||
LL | || }); | ||
| ||_____-^ `&mut Context<'_>` may not be safely transferred across an unwind boundary | ||
| |_____| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Orthogonal to this PR, but these arrows are really hard to follow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to clean up the rendering of overlapping multiline spans, but span labels make them even harder to deal with than usual. |
||
| within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}` | ||
| | ||
= help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>` | ||
= note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>` | ||
|
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.
There are lots of new occurrences of
^^^---^^^
now. I guess the^^^
highlighting and the---
highlighting overlap, and the---
wins?Also, it's weird that the
f1
and the{}
are both pointed to by the^
markers, they don't really seem connected?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.
There's some logic so when primary and secondary spans overlap some bit of information is shown: the largest one is printed "first", and the then each shorter one is printed in order of length, so that at least a bit of each is shown. This is because if, for example in this case, there is a span with a label pointing within a larger one and we weren't doing that, we'd have no way of knowing where the label span ended within the larger span. That's how you end up with this kind of rendering. IIRC, we also tried some tricks with colors to aid here, but don't think they panned out so we didn't land them.
In this case the primary span marks from the
fq
all the way to the closing)
(including the{}
), it's just "visually interrupted" by the span pointing at the closure header.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.
Makes sense. Not for this PR, but I wonder if changing this:
to this:
would help.
W.r.t. my lack of understanding of
---
marking the secondary span, I think it's a lot clearer that---
is marking code when the secondary span label is underneath the---
and there's a|
leading to it, instead of the label being to the right on the same line.