summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-06-15 19:51:35 +0200
committerGitHub <noreply@github.com>2024-06-15 19:51:35 +0200
commitbe1d42776df3bc308634ec888fe97f26404466e9 (patch)
treebe86219d955c598e678c7b86ba19bc9a1b450805 /tests
parent709d8623088c3935527e88fa2600233238dae241 (diff)
parentdcee529e5c9dc505cc28b6b05d50b78ae2ab8b7e (diff)
Rollup merge of #126410 - RalfJung:smir-const-operand, r=oli-obk
smir: merge identical Constant and ConstOperand types The first commit renames the const operand visitor functions on regular MIR to match the type name, that was forgotten in the original rename. The second commit changes stable MIR, fixing https://github.com/rust-lang/project-stable-mir/issues/71. Previously there were two different smir types for the MIR type `ConstOperand`, one used in `Operand` and one in `VarDebugInfoContents`. Maybe we should have done this with https://github.com/rust-lang/rust/pull/125967, so there's only a single breaking change... but I saw that PR too late. Fixes https://github.com/rust-lang/project-stable-mir/issues/71
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/stable-mir/check_transform.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/stable-mir/check_transform.rs
index b203e76e54f..1d3e4c6845b 100644
--- a/tests/ui-fulldeps/stable-mir/check_transform.rs
+++ b/tests/ui-fulldeps/stable-mir/check_transform.rs
@@ -21,7 +21,7 @@ extern crate stable_mir;
use rustc_smir::rustc_internal;
use stable_mir::mir::alloc::GlobalAlloc;
use stable_mir::mir::mono::Instance;
-use stable_mir::mir::{Body, Constant, Operand, Rvalue, StatementKind, TerminatorKind};
+use stable_mir::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind};
use stable_mir::ty::{ConstantKind, MirConst};
use stable_mir::{CrateDef, CrateItems, ItemKind};
use std::convert::TryFrom;
@@ -72,7 +72,7 @@ fn check_msg(body: &Body, expected: &str) {
.unwrap()
}
};
- let ConstantKind::Allocated(alloc) = msg_const.literal.kind() else {
+ let ConstantKind::Allocated(alloc) = msg_const.const_.kind() else {
unreachable!()
};
assert_eq!(alloc.provenance.ptrs.len(), 1);
@@ -96,8 +96,8 @@ fn change_panic_msg(mut body: Body, new_msg: &str) -> Body {
match &mut bb.terminator.kind {
TerminatorKind::Call { args, .. } => {
let new_const = MirConst::from_str(new_msg);
- args[0] = Operand::Constant(Constant {
- literal: new_const,
+ args[0] = Operand::Constant(ConstOperand {
+ const_: new_const,
span: bb.terminator.span,
user_ty: None,
});