rust/tests
bors 21fab435da Auto merge of #104844 - cjgillot:mention-eval-place, r=jackh726,RalfJung
Evaluate place expression in `PlaceMention`

https://github.com/rust-lang/rust/pull/102256 introduces a `PlaceMention(place)` MIR statement which keep trace of `let _ = place` statements from surface rust, but without semantics.

This PR proposes to change the behaviour of `let _ =` patterns with respect to the borrow-checker to verify that the bound place is live.

Specifically, consider this code:
```rust
let _ = {
    let a = 5;
    &a
};
```

This passes borrowck without error on stable. Meanwhile, replacing `_` by `_: _` or `_p` errors with "error[E0597]: `a` does not live long enough", [see playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c448d25a7c205dc95a0967fe96bccce8).

This PR *does not* change how `_` patterns behave with respect to initializedness: it remains ok to bind a moved-from place to `_`.

The relevant test is `tests/ui/borrowck/let_underscore_temporary.rs`. Crater check found no regression.

For consistency, this PR changes miri to evaluate the place found in `PlaceMention`, and report eventual dangling pointers found within it.

r? `@RalfJung`
2023-04-22 09:54:21 +00:00
..
assembly Add inline assembly support for m68k 2023-04-12 17:58:15 -07:00
auxiliary
codegen Auto merge of #109993 - scottmcm:transmute-niches, r=oli-obk 2023-04-20 10:46:13 +00:00
codegen-units Turn off inlining for codegen-unit tests 2023-04-07 15:46:45 -04:00
debuginfo ci: add a runner for vanilla LLVM 16 2023-04-16 11:50:20 -07:00
incremental Add incremental tests. 2023-04-20 18:01:15 +00:00
mir-opt Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkin 2023-04-22 00:10:44 +00:00
pretty Auto merge of #108148 - parthopdas:master, r=oli-obk 2023-03-20 03:24:27 +00:00
run-make Do not rely on exact error code. 2023-04-21 16:14:44 +00:00
run-make-fulldeps Bless run-make-fulldeps test. 2023-04-20 18:03:33 +00:00
run-pass-valgrind
rustdoc Add regression test for #46506 2023-04-20 17:49:13 +02:00
rustdoc-gui Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustdoc-js rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-js-std rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-json Update tests for rustc_doc_primitive 2023-03-30 22:56:52 +02:00
rustdoc-ui Rollup merge of #110501 - notriddle:notriddle/ice-110495, r=petrochenkov 2023-04-21 20:35:28 +05:30
ui Auto merge of #104844 - cjgillot:mention-eval-place, r=jackh726,RalfJung 2023-04-22 09:54:21 +00:00
ui-fulldeps Add Call terminator to SMIR 2023-04-20 12:00:41 -03:00
COMPILER_TESTS.md