1
Fork 0
rust/compiler/rustc_span/src
bors 14c54b637b Auto merge of #107844 - Zeegomo:no-drop-and-rep, r=cjgillot
Desugaring of drop and replace at MIR build

This commit desugars the drop and replace deriving from an
assignment at MIR build, avoiding the construction of the
`DropAndReplace` terminator (which will be removed in a following PR).

In order to retain the same error messages for replaces a new
`DesugaringKind::Replace` variant is introduced.

The changes in the borrowck are also useful for future work in moving drop elaboration
before borrowck, as no `DropAndReplace` would be present there anymore.

Notes on test diffs:
*  `tests/ui/borrowck/issue-58776-borrowck-scans-children`: the assignment deriving from the desugaring kills the borrow.
*  `tests/ui/async-await/async-fn-size-uninit-locals.rs`, `tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir`,  `tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir`:  drop elaboration generates (or reads from) a useless drop flag due to an issue with the dataflow analysis. Will be fixed independently by https://github.com/rust-lang/rust/pull/106430.

See https://github.com/rust-lang/rust/pull/104488 for more context
2023-03-05 07:56:26 +00:00
..
analyze_source_file remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
edit_distance Add test for precise algorithm used 2023-02-19 22:59:22 +00:00
source_map Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkov 2023-01-19 05:23:40 +00:00
symbol Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
analyze_source_file.rs more clippy::complexity fixes 2022-12-15 00:09:10 +01:00
caching_source_map_view.rs Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
def_id.rs Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
edit_distance.rs Make public API, docs algorithm-agnostic 2023-02-19 04:11:10 +00:00
edition.rs Rename rust_2015 => is_rust_2015 2023-02-02 08:17:13 +00:00
fatal_error.rs Make fatal DiagnosticBuilder yield never 2022-03-27 22:25:32 -07:00
hygiene.rs Desugars drop and replace at MIR build 2023-03-03 16:33:11 +01:00
lib.rs Add ErrorGuaranteed to HIR TyKind::Err 2023-02-25 19:46:36 +00:00
profiling.rs Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
source_map.rs Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkov 2023-01-19 05:23:40 +00:00
span_encoding.rs Intern span when length is MAX_LEN with parent. 2023-02-11 17:46:22 +00:00
symbol.rs Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
tests.rs Lazify SourceFile::lines. 2022-06-01 10:36:39 +10:00