[WIP] borrowck diagnostic migration with eager booted#104941
[WIP] borrowck diagnostic migration with eager booted#104941AndyJado wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
(rustbot has picked a reviewer for you, use r? to override) |
|
r? @davidtwco |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Support eager subdiagnostics again See rust-lang#104941 (comment) I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.
|
I'll look at this after we land #104055 |
Support eager subdiagnostics again See rust-lang#104941 (comment) I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.
Support eager subdiagnostics again See rust-lang#104941 (comment) I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.
Support eager subdiagnostics again See rust-lang/rust#104941 (comment) I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
|
I'm back! I'll get the engine running in a few days. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
@davidtwco I suppose this is a need eager on Diagonostic (not Subdiag) case, I've made all my attempts and I can't pass ui test,they are like whack-a-mole
This comment was marked as resolved.
This comment was marked as resolved.
77e8f1b to
5fc91ad
Compare
This comment has been minimized.
This comment has been minimized.
davidtwco
left a comment
There was a problem hiding this comment.
Left some more comments, you'll need to look at where the backticks are being added and make sure that we either only do them in the IntoDiagnosticArg implementations or in the Fluent messages.
| debug!( | ||
| "report_mutability_error: item_msg and reason is moved to a struct due to diagnosing migration: [E0594] & [E0596], now they are typed value: {:?}", | ||
| &diagnostic | ||
| ); |
There was a problem hiding this comment.
You don't need to keep these debug logs if they aren't necessary anymore.
| @@ -1,9 +1,20 @@ | |||
| // #![deny(rustc::untranslatable_diagnostic)] | |||
| // #![deny(rustc::diagnostic_outside_of_impl)] | |||
There was a problem hiding this comment.
This comment still seems relevant.
| } | ||
| } | ||
|
|
||
| pub(super) fn describe_place_typed(&self, place_ref: PlaceRef<'tcx>) -> DescribedPlace { |
There was a problem hiding this comment.
I presume this exists because changing describe_place to return a DescribedPlace` isn't practical?
There was a problem hiding this comment.
describe_place is used a lot, I'm currently narrowing the scope so it covers only PlaceAndReason cases.
| fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { | ||
| match self.0 { | ||
| Some(descr) => descr.into_diagnostic_arg(), | ||
| None => "value".into_diagnostic_arg(), |
| pub(super) struct IncludingTupleField(pub(super) bool); | ||
|
|
||
| #[derive(Debug)] | ||
| pub(super) struct DescribedPlace(pub(super) Option<String>); |
There was a problem hiding this comment.
Why is this necessary if self.0 already implements IntoDiagnosticArg?
| } | ||
| let name = ptr_source.describe_for_immutable_place(self.infcx.tcx); | ||
| diagnostic = PlaceAndReason::BehindPointer( | ||
| self.describe_place_typed(access_place.as_ref()), |
There was a problem hiding this comment.
Ah, so the "value" case in DescribedPlace is to handle the situation of "data" here?
|
I tracked function fn emit_diagnostic(&mut self, diagnostic: &mut Diagnostic) -> Option<ErrorGuaranteed> {
dbg!(&diagnostic.args().collect::<Vec<_>>());I was runing a single UI test. RUST_LOG=[emit_diagnostic] ./x.py test tests/ui/issues/issue-21600.rsHere's the output diff: |
|
☔ The latest upstream changes (presumably #118316) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@AndyJado any updates on this? thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
- error[E0596]: cannot borrow `r` as mutable
+ error[E0596]: cannot borrow ``r`` as mutableI believe the answer lies in the macro implementation but I don't have the guts diving in. @Dylan-DPC I'll keep conflict resolved. |
|
☔ The latest upstream changes (presumably #121489) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #122190) made this pull request unmergeable. Please resolve the merge conflicts. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
☔ The latest upstream changes (presumably #122571) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@AndyJado @rustbot label: +S-inactive |
on top of #104055