Skip to content

Commit 1f335e7

Browse files
committed
fix smir test
1 parent 556e0bf commit 1f335e7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tests/ui-fulldeps/stable-mir/crate-info.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
4747
assert_eq!(body.blocks.len(), 1);
4848
let block = &body.blocks[0];
4949
assert_eq!(block.statements.len(), 1);
50-
match &block.statements[0] {
51-
stable_mir::mir::Statement::Assign(..) => {}
50+
match &block.statements[0].kind {
51+
stable_mir::mir::StatementKind::Assign(..) => {}
5252
other => panic!("{other:?}"),
5353
}
54-
match &block.terminator {
55-
stable_mir::mir::Terminator::Return => {}
54+
match &block.terminator.kind {
55+
stable_mir::mir::TerminatorKind::Return => {}
5656
other => panic!("{other:?}"),
5757
}
5858

@@ -61,36 +61,36 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
6161
assert_eq!(body.locals.len(), 7);
6262
assert_eq!(body.blocks.len(), 4);
6363
let block = &body.blocks[0];
64-
match &block.terminator {
65-
stable_mir::mir::Terminator::Call { .. } => {}
64+
match &block.terminator.kind {
65+
stable_mir::mir::TerminatorKind::Call { .. } => {}
6666
other => panic!("{other:?}"),
6767
}
6868

6969
let types = get_item(&items, (DefKind::Fn, "types")).unwrap();
7070
let body = types.body();
7171
assert_eq!(body.locals.len(), 6);
7272
assert_matches!(
73-
body.locals[0].kind(),
73+
body.locals[0].ty.kind(),
7474
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
7575
);
7676
assert_matches!(
77-
body.locals[1].kind(),
77+
body.locals[1].ty.kind(),
7878
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
7979
);
8080
assert_matches!(
81-
body.locals[2].kind(),
81+
body.locals[2].ty.kind(),
8282
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Char)
8383
);
8484
assert_matches!(
85-
body.locals[3].kind(),
85+
body.locals[3].ty.kind(),
8686
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Int(stable_mir::ty::IntTy::I32))
8787
);
8888
assert_matches!(
89-
body.locals[4].kind(),
89+
body.locals[4].ty.kind(),
9090
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Uint(stable_mir::ty::UintTy::U64))
9191
);
9292
assert_matches!(
93-
body.locals[5].kind(),
93+
body.locals[5].ty.kind(),
9494
stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Float(
9595
stable_mir::ty::FloatTy::F64
9696
))
@@ -100,24 +100,24 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
100100
let body = drop.body();
101101
assert_eq!(body.blocks.len(), 2);
102102
let block = &body.blocks[0];
103-
match &block.terminator {
104-
stable_mir::mir::Terminator::Drop { .. } => {}
103+
match &block.terminator.kind {
104+
stable_mir::mir::TerminatorKind::Drop { .. } => {}
105105
other => panic!("{other:?}"),
106106
}
107107

108108
let assert = get_item(&items, (DefKind::Fn, "assert")).unwrap();
109109
let body = assert.body();
110110
assert_eq!(body.blocks.len(), 2);
111111
let block = &body.blocks[0];
112-
match &block.terminator {
113-
stable_mir::mir::Terminator::Assert { .. } => {}
112+
match &block.terminator.kind {
113+
stable_mir::mir::TerminatorKind::Assert { .. } => {}
114114
other => panic!("{other:?}"),
115115
}
116116

117117
let monomorphic = get_item(&items, (DefKind::Fn, "monomorphic")).unwrap();
118118
for block in monomorphic.body().blocks {
119-
match &block.terminator {
120-
stable_mir::mir::Terminator::Call { func, .. } => match func {
119+
match &block.terminator.kind {
120+
stable_mir::mir::TerminatorKind::Call { func, .. } => match func {
121121
stable_mir::mir::Operand::Constant(c) => match &c.literal.literal {
122122
stable_mir::ty::ConstantKind::Allocated(alloc) => {
123123
assert!(alloc.bytes.is_empty());
@@ -127,7 +127,7 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
127127
mut args,
128128
)) => {
129129
let func = def.body();
130-
match func.locals[1]
130+
match func.locals[1].ty
131131
.fold(&mut args)
132132
.continue_value()
133133
.unwrap()
@@ -149,7 +149,7 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
149149
},
150150
other => panic!("{other:?}"),
151151
},
152-
stable_mir::mir::Terminator::Return => {}
152+
stable_mir::mir::TerminatorKind::Return => {}
153153
other => panic!("{other:?}"),
154154
}
155155
}

0 commit comments

Comments
 (0)