Revert "require full validity when determining the discriminant of a value"
This reverts commit0a2b7d71d9
, reversing changes made to47c1bd1bcc
. This caused several unforeseen problems: - https://github.com/rust-lang/rust/issues/91029 - https://github.com/rust-lang/rust/pull/89764#issuecomment-973588007
This commit is contained in:
parent
93542a8240
commit
70d418c315
2 changed files with 0 additions and 12 deletions
|
@ -304,12 +304,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
|
||||
Discriminant(place) => {
|
||||
let op = self.eval_place_to_op(place, None)?;
|
||||
if M::enforce_validity(self) {
|
||||
// This is 'using' the value, so make sure the validity invariant is satisfied.
|
||||
// (Also see https://github.com/rust-lang/rust/pull/89764.)
|
||||
self.validate_operand(&op)?;
|
||||
}
|
||||
|
||||
let discr_val = self.read_discriminant(&op)?.0;
|
||||
self.write_scalar(discr_val, &dest)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue