rust/compiler
Dhruv Jauhar 1f53754236 Provide diagnostic suggestion in ExprUseVisitor Delegate
The [Delegate
trait](981346fc07/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
2020-11-02 01:31:34 -05:00
..
rustc just max_level_info 2020-09-11 09:37:51 -07:00
rustc_apfloat Backport another LLVM commit to rustc_apfloat 2020-10-04 02:02:25 +02:00
rustc_arena Track element count only for types that need drop 2020-10-20 17:01:51 +02:00
rustc_ast Auto merge of #77250 - Aaron1011:feature/flat-token-collection, r=petrochenkov 2020-10-21 15:03:14 +00:00
rustc_ast_lowering Auto merge of #78066 - bugadani:wat, r=jonas-schievink 2020-10-18 13:50:31 +00:00
rustc_ast_passes Lower inline const's AST to HIR 2020-10-16 15:21:16 -03:00
rustc_ast_pretty Drop unneeded mut 2020-10-20 16:42:51 +02:00
rustc_attr Move PartialOrd impl out of rustc 2020-10-11 11:11:33 -04:00
rustc_builtin_macros Replace target.target with target and target.ptr_width with target.pointer_width 2020-10-15 12:02:24 +02:00
rustc_codegen_llvm Auto merge of #78047 - khyperia:set_span_mut, r=bjorn3 2020-10-18 05:36:23 +00:00
rustc_codegen_ssa Make set_span take mut self 2020-10-17 13:28:58 +02:00
rustc_data_structures Auto merge of #77908 - bugadani:obl-forest, r=nnethercote 2020-10-19 15:14:15 +00:00
rustc_driver Rollup merge of #77493 - hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk 2020-10-16 02:10:09 +02:00
rustc_error_codes Rollup merge of #77971 - jyn514:broken-intra-doc-links, r=mark-simulacrum 2020-10-17 05:36:49 +09:00
rustc_errors Remove unused code from remaining compiler crates 2020-10-14 04:14:32 +02:00
rustc_expand Avoid cloning the contents of a TokenStream in a few places 2020-10-19 12:30:41 -04:00
rustc_feature Remove redundant 'static in the compiler 2020-10-18 17:30:15 +02:00
rustc_fs_util Remove unused code from remaining compiler crates 2020-10-14 04:14:32 +02:00
rustc_graphviz /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_hir Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_hir_pretty Do not print braces again print_anon_const already does it 2020-10-19 16:26:13 -03:00
rustc_incremental /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_index cache types during normalization 2020-09-19 17:27:13 +02:00
rustc_infer Lift: take self by value 2020-10-21 23:59:35 +02:00
rustc_interface Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obk 2020-10-14 02:30:38 +02:00
rustc_lexer Noticed a potential bug in eat_while(): it doesn't account for number of UTF8 bytes. 2020-10-09 11:12:54 +02:00
rustc_lint Rollup merge of #77931 - aticu:fix_60336, r=petrochenkov 2020-10-20 12:11:06 +09:00
rustc_llvm Auto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikic 2020-10-11 20:50:02 +00:00
rustc_macros Lift: take self by value 2020-10-21 23:59:35 +02:00
rustc_metadata Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_middle Auto merge of #78027 - lcnr:lift-by-value, r=varkor 2020-10-21 23:09:38 +00:00
rustc_mir review 2020-10-21 23:59:35 +02:00
rustc_mir_build Auto merge of #77124 - spastorino:const-exprs-rfc-2920, r=oli-obk 2020-10-17 14:44:51 +00:00
rustc_parse Auto merge of #77250 - Aaron1011:feature/flat-token-collection, r=petrochenkov 2020-10-21 15:03:14 +00:00
rustc_parse_format /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_passes Auto merge of #78066 - bugadani:wat, r=jonas-schievink 2020-10-18 13:50:31 +00:00
rustc_plugin_impl /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_privacy Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_query_system Remove unused code from rustc_query_system 2020-10-14 04:14:32 +02:00
rustc_resolve Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_save_analysis /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_serialize Replace absolute paths with relative ones 2020-10-13 14:16:45 +02:00
rustc_session Remove rustc_session::config::Config 2020-10-15 12:02:24 +02:00
rustc_span Add inline_const feature flag 2020-10-16 15:13:28 -03:00
rustc_symbol_mangling Rollup merge of #75675 - davidtwco:symbol-mangling-impl-params, r=eddyb 2020-10-16 02:10:02 +02:00
rustc_target Replace target.target with target and target.ptr_width with target.pointer_width 2020-10-15 12:02:24 +02:00
rustc_trait_selection Rollup merge of #78002 - estebank:issue-77598, r=oli-obk 2020-10-21 13:59:35 +09:00
rustc_traits Review comments 2020-10-16 12:58:50 -04:00
rustc_ty Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_typeck Provide diagnostic suggestion in ExprUseVisitor Delegate 2020-11-02 01:31:34 -05:00