diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-09-29 17:30:07 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-09-29 19:20:33 -0700 |
| commit | b400871b9c07951d79dd9158af44dfdebcb8ad65 (patch) | |
| tree | 110b77ef79b13860f297484f94c38372ec5919db /compiler | |
| parent | 5b3145574e828659cb9c6d671a4b19ac3989b0b4 (diff) | |
| download | rust-b400871b9c07951d79dd9158af44dfdebcb8ad65.tar.gz rust-b400871b9c07951d79dd9158af44dfdebcb8ad65.zip | |
Don't emit duplicate errors for the return place
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_consts/validation.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index e0dd7970883..0781a76a166 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -237,7 +237,8 @@ impl Validator<'mir, 'tcx> { self.check_item_predicates(); for (idx, local) in body.local_decls.iter_enumerated() { - if local.internal { + // Handle the return place below. + if idx == RETURN_PLACE || local.internal { continue; } |
