diff options
| author | Ralf Jung <post@ralfj.de> | 2023-09-20 20:51:14 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-09-21 08:12:30 +0200 |
| commit | c94410c1458f9ea55e51fc9af478d94a82ec90a0 (patch) | |
| tree | 03d021ce987ce3e284a1e0a05d0a1c7e0622d983 /compiler/rustc_mir_transform/src/instsimplify.rs | |
| parent | a2374e65aafd47fa68a3954fa2a3116c519aa7e5 (diff) | |
| download | rust-c94410c1458f9ea55e51fc9af478d94a82ec90a0.tar.gz rust-c94410c1458f9ea55e51fc9af478d94a82ec90a0.zip | |
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const
Diffstat (limited to 'compiler/rustc_mir_transform/src/instsimplify.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/instsimplify.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs index 6e191b285be..a6ef2e11aa8 100644 --- a/compiler/rustc_mir_transform/src/instsimplify.rs +++ b/compiler/rustc_mir_transform/src/instsimplify.rs @@ -104,7 +104,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> { fn try_eval_bool(&self, a: &Operand<'_>) -> Option<bool> { let a = a.constant()?; - if a.literal.ty().is_bool() { a.literal.try_to_bool() } else { None } + if a.const_.ty().is_bool() { a.const_.try_to_bool() } else { None } } /// Transform "&(*a)" ==> "a". @@ -136,8 +136,8 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> { return; } - let literal = ConstantKind::from_ty_const(len, self.tcx); - let constant = Constant { span: source_info.span, literal, user_ty: None }; + let const_ = Const::from_ty_const(len, self.tcx); + let constant = ConstOperand { span: source_info.span, const_, user_ty: None }; *rvalue = Rvalue::Use(Operand::Constant(Box::new(constant))); } } |
