Uh oh!
There was an error while loading. Please reload this page.
Do not ICE on missing access place description during mutability error reporting - #61192
Do not ICE on missing access place description during mutability error reporting#61192estebank wants to merge 4 commits into
Conversation
rust-highfive
commented
May 25, 2019
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
estebank
commented
May 25, 2019
Cc @rust-lang/wg-diagnostics @cramertj for wording |
davidtwco
commented
May 25, 2019
I've only had a cursory glance, but would we be able to give the name of the place if we allowed |
estebank
commented
May 25, 2019
We could probably detect the |
Uh oh!
There was an error while loading. Please reload this page.
Disregard, just managed to get it working (was looking at the wrong span). |
Uh oh!
There was an error while loading. Please reload this page.
| (None, Place::Base(PlaceBase::Local(local))) if self.mir.local_decls[*local] | ||
| .source_info.span.is_compiler_desugaring(CompilerDesugaringKind::Async) | ||
| => "`async fn` parameter".to_string(), | ||
| (None, _) => "temporary place".to_string(), |
There was a problem hiding this comment.
I don't see any output actually producing this. Should we bug! or at least delay_span_bug here?
oli-obk
commented
May 29, 2019
@bors r+ p=5 async await priorization my nit may be fixed in a separate PR |
bors
commented
May 29, 2019
📌 Commit d72f97d has been approved by |
Centril
commented
May 29, 2019
oli-obk
commented
May 29, 2019
"just following orders" 😛 |
Do not ICE on missing access place description during mutability error reporting Fixrust-lang#61187.
Do not ICE on missing access place description during mutability error reporting Fixrust-lang#61187.
Do not ICE on missing access place description during mutability error reporting Fixrust-lang#61187.
Do not ICE on missing access place description during mutability error reporting Fixrust-lang#61187.
matthewjasper
commented
May 29, 2019
I don't think this is really the correct fix, the variable being mutated here shouldn't have it's Span marked. I guess this is fine for now. |
Do not ICE on missing access place description during mutability error reporting Fixrust-lang#61187.
EDIT: Nevermind, I misremembered, and didn't read the following method carefully enough during review: rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 280 to 289 in 8197085 yea, we should probably not mark the local's span during HIR lowering. |
oli-obk
commented
May 29, 2019
@bors r- |
estebank
commented
May 31, 2019
@oli-obk why shouldn't we? I believe there are a couple of places where we mark spans that aren't strictly part of the desugared output, but that not marking would make it impossible to provide good diagnostics in some cases. I believe this might just be one of these cases :-/ |
davidtwco
commented
May 31, 2019
In this instance, the span is marked to avoid |
oli-obk
commented
May 31, 2019
Hmm... in that case, would it make sense to special case |
matthewjasper
commented
May 31, 2019
The problems is that we are marking more than we should be. The lowered code here looks like: asyncfnresponse(data:Vec<u8>// This is an internal variable, it should have its Span marked) -> ::std::future::from_generator(move || {let data // This variable is effectively the user's parameter, it should not have it's Span marked
= data; data.reverse();})This is causing false negatives in cases like: #![deny(unused_mut)]pubasyncfnresponse(mutdata:Vec<u8>){let _ = data;} |
davidtwco
commented
May 31, 2019
…-sane-way, r=eddyb Re-implement async fn drop order lowering This PR re-implements the async fn drop order lowering changes so that it all takes place in HIR lowering, building atop the work done by @eddyb to refactor `Res::Upvar`. Previously, this types involved in the lowering were constructed in libsyntax as they had to be used during name resolution and HIR lowering. This was awful because none of that logic should have existed in libsyntax. This commit also changes `ArgSource` to keep a `HirId` to the original argument pattern rather than a cloned copy of the pattern. Only b7aa4ed and 71fb8fa should be reviewed, any other commits are from rust-lang#61276 (though 447e336 might end up staying in this PR). As a nice side effect, it also fixesrust-lang#61187 (cc rust-lang#61192). r? @eddyb cc @cramertj
…-sane-way, r=eddyb Re-implement async fn drop order lowering This PR re-implements the async fn drop order lowering changes so that it all takes place in HIR lowering, building atop the work done by @eddyb to refactor `Res::Upvar`. Previously, this types involved in the lowering were constructed in libsyntax as they had to be used during name resolution and HIR lowering. This was awful because none of that logic should have existed in libsyntax. This commit also changes `ArgSource` to keep a `HirId` to the original argument pattern rather than a cloned copy of the pattern. Only b7aa4ed and 71fb8fa should be reviewed, any other commits are from rust-lang#61276 (though 447e336 might end up staying in this PR). As a nice side effect, it also fixesrust-lang#61187 (cc rust-lang#61192). r? @eddyb cc @cramertj
…-sane-way, r=eddyb Re-implement async fn drop order lowering This PR re-implements the async fn drop order lowering changes so that it all takes place in HIR lowering, building atop the work done by @eddyb to refactor `Res::Upvar`. Previously, this types involved in the lowering were constructed in libsyntax as they had to be used during name resolution and HIR lowering. This was awful because none of that logic should have existed in libsyntax. This commit also changes `ArgSource` to keep a `HirId` to the original argument pattern rather than a cloned copy of the pattern. Only b7aa4ed and 71fb8fa should be reviewed, any other commits are from rust-lang#61276 (though 447e336 might end up staying in this PR). As a nice side effect, it also fixesrust-lang#61187 (cc rust-lang#61192). r? @eddyb cc @cramertj
Fix#61187.