Skip to content

Commit

Permalink
revert behaviour to warn!
Browse files Browse the repository at this point in the history
  • Loading branch information
ouz-a committed Sep 7, 2023
1 parent 1a3a62c commit 25cd191
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions compiler/rustc_codegen_ssa/src/mir/locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use rustc_index::IndexVec;
use rustc_middle::mir;
use rustc_middle::ty::print::with_no_trimmed_paths;
use std::ops::{Index, IndexMut};

pub(super) struct Locals<'tcx, V> {
values: IndexVec<mir::Local, LocalRef<'tcx, V>>,
}
Expand Down Expand Up @@ -37,7 +36,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub(super) fn initialize_locals(&mut self, values: Vec<LocalRef<'tcx, Bx::Value>>) {
assert!(self.locals.values.is_empty());
// FIXME(#115215): After #115025 get's merged this might not be necessary
for (_, value) in values.into_iter().enumerate() {
for (local, value) in values.into_iter().enumerate() {
match value {
LocalRef::Place(_) | LocalRef::UnsizedPlace(_) | LocalRef::PendingOperand => (),
LocalRef::Operand(op) => {
let local = mir::Local::from_usize(local);
let expected_ty = self.monomorphize(self.mir.local_decls[local].ty);
if expected_ty != op.layout.ty {
warn!("Unexpected initial operand type. See the issues/114858");
}
}
}
self.locals.values.push(value);
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/codegen/subtyping-enforces-type-equality.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// build-pass
// edition:2021
#![allow(warnings)]
use std::future::Future;
use std::pin::Pin;

Expand Down
1 change: 1 addition & 0 deletions tests/ui/codegen/subtyping-enforces-type-equality.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type. See the issues/114858

0 comments on commit 25cd191

Please sign in to comment.