Uh oh!
There was an error while loading. Please reload this page.
Remove textual span from diagnostic string - #89555
Conversation
rust-highfive
commented
Oct 5, 2021
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
| LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a { | ||
| | ^^^^^^^^^^^^^^ | ||
| | -- ^^^^^^^^^^^^^^ | ||
| | | | ||
| | hidden type `&'a mut &'b T` captures the lifetime `'b` as defined here |
There was a problem hiding this comment.
Should we mention that "hidden type &'a mut &'b T" is impl Swap + 'a in some way? Either with a label on the primary span or mentioning it explicitly in a note? (Doesn't need to be addressed in this PR)
There was a problem hiding this comment.
I'll also wait with this until the primary span stops pointing to the return type with lazy TAIT
| error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds | ||
| --> $DIR/error-handling-2.rs:13:60 | ||
| --> $DIR/error-handling-2.rs:10:60 | ||
| | | ||
| LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { | ||
| | ^^^^^^^^^ | ||
| | | ||
| note: hidden type `*mut &'a i32` captures the lifetime `'a` as defined on the function body at 13:8 | ||
| --> $DIR/error-handling-2.rs:13:8 | ||
| | | ||
| LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { | ||
| | ^^ | ||
| | -- ^^^^^^^^^ | ||
| | | | ||
| | hidden type `*mut &'a i32` captures the lifetime `'a` as defined here |
There was a problem hiding this comment.
In this case, then we should maybe have a label pointing at the type E definition saying "this is the hidden type", if we do what I mentioned earlier?
There was a problem hiding this comment.
I am not sure. Is is helpful to know where the opaque type is declared? If it were a struct or just a regular type alias, we would not be pointing at the definition either.
I could see it making sense to point at the definition for trait bound mismatches, as these are only written at the definition, but all the lifetimes are local to this function and could have confusingly different names on the declaration
There was a problem hiding this comment.
What about having a primary span saying "hiden type returned here" or something along those lines?
There was a problem hiding this comment.
🤣 yes, that is exactly what we need, but without lazy TAIT that is going to be a pain to figure out... or... hmm maybe not, I have an idea
There was a problem hiding this comment.
The idea would kind of work, but it's horrible and not something to do quickly
estebank
commented
Oct 7, 2021
r? @estebank r=me with or without the nitpicks addressed (I see that this is blocking another PR, so if you don't want to deal with it we can create an E-easy ticket for someone else to tackle it) |
oli-obk
commented
Oct 8, 2021
@bors r=estebank |
bors
commented
Oct 8, 2021
📌 Commit d3871f5 has been approved by |
… r=estebank Remove textual span from diagnostic string This is an unnecessary repetition, as the diagnostic prints the span anyway in the source path right below the message. I further removed the identification of the node, as that does not give any new information in any of the cases that are changed in tests. EDIT: also inserted a suggestion that other diagnostics were already emitting
@bors r- Failed in rollup: #89671 (comment) Looks like some more tests may need to be blessed. |
oli-obk
commented
Oct 8, 2021
@bors r=estebank |
bors
commented
Oct 8, 2021
📌 Commit 09d1774 has been approved by |
… r=estebank Remove textual span from diagnostic string This is an unnecessary repetition, as the diagnostic prints the span anyway in the source path right below the message. I further removed the identification of the node, as that does not give any new information in any of the cases that are changed in tests. EDIT: also inserted a suggestion that other diagnostics were already emitting
GuillaumeGomez
commented
Oct 9, 2021
camelid
commented
Oct 9, 2021
@bors rollup=iffy |
09d1774 to
724bc1cCompareoli-obk
commented
Oct 12, 2021
@bors r=estebank |
bors
commented
Oct 12, 2021
📌 Commit 724bc1cbd3161ab1581ab54789807731f3628056 has been approved by |
bors
commented
Oct 13, 2021
⌛ Testing commit 724bc1cbd3161ab1581ab54789807731f3628056 with merge 8e9f48623c91b6baadd21004928795845c9baa98... |
This comment has been minimized.
This comment has been minimized.
bors
commented
Oct 13, 2021
💔 Test failed - checks-actions |
724bc1c to
20d6aadCompareoli-obk
commented
Oct 13, 2021
@bors r=estebank |
bors
commented
Oct 13, 2021
📌 Commit 20d6aad has been approved by |
bors
commented
Oct 13, 2021
bors
commented
Oct 13, 2021
☀️ Test successful - checks-actions |
rust-timer
commented
Oct 14, 2021
Finished benchmarking commit (dfc5add): comparison url. Summary: This change led to moderate relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This is an unnecessary repetition, as the diagnostic prints the span anyway in the source path right below the message.
I further removed the identification of the node, as that does not give any new information in any of the cases that are changed in tests.
EDIT: also inserted a suggestion that other diagnostics were already emitting