Skip to content

Commit b400871

Browse files
Don't emit duplicate errors for the return place
1 parent 5b31455 commit b400871

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_mir/src/transform/check_consts/validation.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ impl Validator<'mir, 'tcx> {
237237
self.check_item_predicates();
238238

239239
for (idx, local) in body.local_decls.iter_enumerated() {
240-
if local.internal {
240+
// Handle the return place below.
241+
if idx == RETURN_PLACE || local.internal {
241242
continue;
242243
}
243244

0 commit comments

Comments
 (0)