rust/compiler
bors e60e19bc65 Auto merge of #90179 - Nilstrieb:lifetime-elision-mismatch-hint, r=estebank
Add beginner friendly lifetime elision hint to E0623

Address #90170

Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't.

Example:

```
error[E0623]: lifetime mismatch
  --> $DIR/issue-90170-elision-mismatch.rs:2:35
   |
LL | fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) {
   |                 ---------           --------- these two types are declared with different lifetimes...
LL |     core::mem::swap(&mut slice_a, &mut slice_b);
   |                                   ^^^^^^^^^^^^ ...but data from `slice_b` flows into `slice_a` here
   |
   = note: each elided lifetime in input position becomes a distinct lifetime
help: explicitly declare a lifetime and assign it to both
   |
LL | fn foo<'a>(slice_a: &'a mut [u8], slice_b: &'a mut [u8]) {
   |       ++++           ++                     ++

```

for

```rust
fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) {
    core::mem::swap(&mut slice_a, &mut slice_b);
}
```
2021-11-04 00:39:21 +00:00
..
rustc
rustc_apfloat Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_arena
rustc_ast fix: inner attribute followed by outer attribute causing ICE 2021-10-25 17:31:27 +02:00
rustc_ast_lowering Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr 2021-10-29 04:55:51 +00:00
rustc_ast_passes Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_ast_pretty Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
rustc_attr Correct typo 2021-10-16 13:36:05 -07:00
rustc_borrowck Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr 2021-10-29 04:55:51 +00:00
rustc_builtin_macros Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_codegen_cranelift Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_gcc Auto merge of #89652 - rcvalle:rust-cfi, r=nagisa 2021-10-27 09:19:42 +00:00
rustc_codegen_llvm Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_codegen_ssa Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_const_eval addr_of! grants mutable access, maybe? 2021-11-03 16:43:12 +01:00
rustc_data_structures Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr 2021-10-29 04:55:51 +00:00
rustc_driver Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_error_codes Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726 2021-10-22 19:42:46 +09:00
rustc_errors Lint against RTL unicode codepoints in literals and comments 2021-10-31 13:14:04 +01:00
rustc_expand Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_feature Rollup merge of #90502 - GuillaumeGomez:split-doc-cfg-feature, r=jyn514 2021-11-02 23:48:50 +01:00
rustc_fs_util
rustc_graphviz Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_hir Auto merge of #90406 - nbdd0121:panic, r=cjgillot 2021-11-01 17:18:57 +00:00
rustc_hir_pretty Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister 2021-10-18 19:53:05 +00:00
rustc_incremental Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_index update cfg(bootstrap) 2021-10-23 21:55:57 -04:00
rustc_infer Add beginner friendly lifetime elision hint to E0623 2021-11-03 20:10:44 +01:00
rustc_interface Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_lexer Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_lint Auto merge of #90463 - matthiaskrgr:rollup-eljk9vo, r=matthiaskrgr 2021-11-01 14:00:08 +00:00
rustc_lint_defs Auto merge of #90463 - matthiaskrgr:rollup-eljk9vo, r=matthiaskrgr 2021-11-01 14:00:08 +00:00
rustc_llvm Auto merge of #90205 - mati865:link-modifiers-in-rustc, r=petrochenkov 2021-10-30 16:22:49 +00:00
rustc_macros Avoid a branch on key being local for queries that use the same local and extern providers 2021-10-25 13:36:23 +02:00
rustc_metadata Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov 2021-10-30 20:30:27 +02:00
rustc_middle Add a few query descriptions 2021-10-29 11:15:45 -04:00
rustc_mir_build Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_mir_dataflow Remove MaybeMutBorrowedLocals 2021-11-03 16:43:12 +01:00
rustc_mir_transform Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_monomorphize Auto merge of #90406 - nbdd0121:panic, r=cjgillot 2021-11-01 17:18:57 +00:00
rustc_parse fix formatting 2021-11-01 10:39:43 +01:00
rustc_parse_format
rustc_passes Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelid 2021-10-30 14:37:00 +02:00
rustc_plugin_impl Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_privacy Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_query_impl Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_query_system Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr 2021-10-29 04:55:51 +00:00
rustc_resolve Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov 2021-10-30 20:30:27 +02:00
rustc_save_analysis Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_serialize Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_session Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_span Remove MaybeMutBorrowedLocals 2021-11-03 16:43:12 +01:00
rustc_symbol_mangling Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_target Use apple-a14 as target CPU for aarch64-apple-darwin. 2021-11-01 17:03:07 +01:00
rustc_trait_selection Rollup merge of #90417 - lcnr:stabilize-relaxed-struct-unsizing, r=wesleywiser 2021-11-02 23:48:47 +01:00
rustc_traits Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
rustc_ty_utils Auto merge of #90218 - JakobDegen:adt_significant_drop_fix, r=nikomatsakis 2021-10-28 16:03:13 +00:00
rustc_type_ir Add two inline annotations for hot functions 2021-10-03 12:43:43 -04:00
rustc_typeck Rollup merge of #90399 - yuvaldolev:as-ref-overly-verbose-diagnostic, r=estebank 2021-10-30 20:30:28 +02:00