about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-05-01 17:10:24 +0200
committerGitHub <noreply@github.com>2023-05-01 17:10:24 +0200
commitf835b13812e505830370f5dde863d4ff9cabe2a6 (patch)
tree6684287fa82beb666a153d7a9e78dd5cb69a133a /compiler/rustc_codegen_llvm/src/builder.rs
parent8a9e696f43aee4b184be2e1e01fa1f6048d7aba1 (diff)
parentc678acd3a275c9acd34c2ecfa9b7b06e2ca7874f (diff)
downloadrust-f835b13812e505830370f5dde863d4ff9cabe2a6.tar.gz
rust-f835b13812e505830370f5dde863d4ff9cabe2a6.zip
Rollup merge of #111038 - tmiasko:untainted-promoteds, r=compiler-errors
Leave promoteds untainted by errors when borrowck fails

Previously, when borrowck failed it would taint all promoteds within the MIR body. An attempt to evaluated the promoteds would subsequently fail with spurious "note: erroneous constant used". For example:

```console
...
note: erroneous constant used
 --> tests/ui/borrowck/tainted-promoteds.rs:7:9
  |
7 |     a = &0 * &1 * &2 * &3;
  |         ^^

note: erroneous constant used
 --> tests/ui/borrowck/tainted-promoteds.rs:7:14
  |
7 |     a = &0 * &1 * &2 * &3;
  |              ^^

note: erroneous constant used
 --> tests/ui/borrowck/tainted-promoteds.rs:7:19
  |
7 |     a = &0 * &1 * &2 * &3;
  |                   ^^

note: erroneous constant used
 --> tests/ui/borrowck/tainted-promoteds.rs:7:24
  |
7 |     a = &0 * &1 * &2 * &3;
  |                        ^^
```

Borrowck failure doesn't indicate that there is anything wrong with promoteds. Leave them untainted.

Fixes #110856.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
0 files changed, 0 insertions, 0 deletions