rust/tests
Matthias Krüger 434232f7b2
Rollup merge of #118426 - aDotInTheVoid:const-wat, r=compiler-errors,cjgillot
ConstProp: Correctly remove const if unknown value assigned to it.

Closes #118328

The problematic sequence of MIR is:

```rust
          _1 = const 0_usize;
          _1 = const _; // This is an associated constant we can't know before monomorphization.
          _0 = _1;
```

1. When `ConstProp::visit_assign` happens on `_1 = const 0_usize;`, it records that `0x0usize` is the value for `_1`.
2. Next `visit_assign` happens on `_1 = const _;`. Because the rvalue `.has_param()`, it can't be const evaled.
3. Finaly, `visit_assign` happens on `_0 = _1;`. Here it would think the value of `_1` was `0x0usize` from step 1.

The solution is to remove consts when checking the RValue fails, as they may have contained values that should now be invalidated, as that local was overwritten.

This should probably be back-ported to beta. Stable is more iffy, as it's gone unidentified since 1.70, so I only think it's worthwhile if there's another reason for a 1.74.1 release anyway.
2023-11-29 12:34:50 +01:00
..
assembly Update the minimum external LLVM to 16. 2023-11-21 22:40:16 +01:00
auxiliary
codegen update test for new LLVM 18 codegen 2023-11-28 12:10:59 +00:00
codegen-units
coverage coverage: Simplify building coverage expressions based on sums 2023-11-25 12:29:20 +11:00
coverage-run-rustdoc coverage: Rename the run-coverage test mode to coverage-run 2023-11-08 16:41:24 +11:00
debuginfo
incremental
mir-opt Rollup merge of #118426 - aDotInTheVoid:const-wat, r=compiler-errors,cjgillot 2023-11-29 12:34:50 +01:00
pretty
run-make Rollup merge of #118202 - azhogin:azhogin/link_args_wrapping, r=petrochenkov 2023-11-27 19:06:47 -05:00
run-make-fulldeps Merge Queries::{ongoing_codegen,linker}. 2023-11-22 13:22:49 +11:00
run-pass-valgrind
rustdoc Rollup merge of #118224 - dtolnay:rustdocsortunstable, r=fmease 2023-11-24 08:23:54 +01:00
rustdoc-gui rustdoc-search: add support for associated types 2023-11-19 18:54:36 -07:00
rustdoc-js rustdoc-search: avoid infinite where clause unbox 2023-11-24 10:42:11 -07:00
rustdoc-js-std rustdoc-search: make primitives and keywords less special 2023-11-21 13:59:26 -07:00
rustdoc-json rustdoc-json: Fix test so it actuall checks things 2023-11-09 12:13:16 +00:00
rustdoc-ui Manual find replace updates 2023-11-24 21:04:51 +01:00
ui Rollup merge of #118426 - aDotInTheVoid:const-wat, r=compiler-errors,cjgillot 2023-11-29 12:34:50 +01:00
ui-fulldeps Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
COMPILER_TESTS.md