about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-04 22:45:15 +0000
committerbors <bors@rust-lang.org>2020-11-04 22:45:15 +0000
commit0fb00251a578018430bad6687ff74e14031d2a07 (patch)
treefb8f8a5ad6d94fdf631e56d6e0c6324ad3e88169 /compiler/rustc_mir/src/transform/coverage/graph.rs
parentf2bbdd0a3257cc980c934a92c5bf9808cf31728c (diff)
parentc9d9359b00b20cd0a2b07b044098a3318bd3292b (diff)
downloadrust-0fb00251a578018430bad6687ff74e14031d2a07.tar.gz
rust-0fb00251a578018430bad6687ff74e14031d2a07.zip
Auto merge of #78662 - sexxi-goose:add_expr_id_to_delegate, r=nikomatsakis
Provide diagnostic suggestion in ExprUseVisitor Delegate

The [Delegate trait](https://github.com/rust-lang/rust/blob/981346fc07dd5ef414c5b1b21999f7604cece006/compiler/rustc_typeck/src/expr_use_visitor.rs#L28-L38) currently use `PlaceWithHirId` which is composed of Hir `Place` and the
corresponding expression id.

Even though this is an accurate way of expressing how a Place is used,
it can cause confusion during diagnostics.

Eg:

```
let arr : [String; 5];

let [a, ...]     =   arr;
 ^^^ E1 ^^^      =  ^^E2^^
 ```

 Here `arr` is moved because of the binding created E1. However, when we
 point to E1 in diagnostics with the message `arr` was moved, it can be
 confusing.  Rather we would like to report E2 to the user.

 Closes: https://github.com/rust-lang/project-rfc-2229/issues/20

r? `@ghost`
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions