diff options
| author | Dhruv Jauhar <dhruvjhr@gmail.com> | 2020-11-01 02:15:22 -0500 |
|---|---|---|
| committer | Dhruv Jauhar <dhruvjhr@gmail.com> | 2020-11-02 01:31:34 -0500 |
| commit | 5f973264bdcd75b8d0cc3613dcfe5b7608e435d3 (patch) | |
| tree | 19c18c8ca3618d71e4bcf42253bd10025a4a0ffc /compiler/rustc_mir/src/transform/coverage/query.rs | |
| parent | 82f775d2c4fd25615d7db2a5340aae0ee9f9901b (diff) | |
| download | rust-5f973264bdcd75b8d0cc3613dcfe5b7608e435d3.tar.gz rust-5f973264bdcd75b8d0cc3613dcfe5b7608e435d3.zip | |
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
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/query.rs')
0 files changed, 0 insertions, 0 deletions
