Skip to content

Commit 09829e1

Browse files
committed
test: fix the usage of rustc_internal::internal()
1 parent aa6b7df commit 09829e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/ui-fulldeps/stable-mir/smir_internal.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ extern crate rustc_interface;
1717
extern crate rustc_middle;
1818
extern crate stable_mir;
1919

20+
use rustc_middle::ty::TyCtxt;
2021
use rustc_smir::rustc_internal;
2122
use std::io::Write;
2223
use std::ops::ControlFlow;
2324

2425
const CRATE_NAME: &str = "input";
2526

26-
fn test_translation() -> ControlFlow<()> {
27+
fn test_translation(tcx: TyCtxt<'_>) -> ControlFlow<()> {
2728
let main_fn = stable_mir::entry_fn().unwrap();
2829
let body = main_fn.expect_body();
2930
let orig_ty = body.locals()[0].ty;
30-
let rustc_ty = rustc_internal::internal(&orig_ty);
31+
let rustc_ty = rustc_internal::internal(tcx, &orig_ty);
3132
assert!(rustc_ty.is_unit());
3233
ControlFlow::Continue(())
3334
}
@@ -45,7 +46,7 @@ fn main() {
4546
CRATE_NAME.to_string(),
4647
path.to_string(),
4748
];
48-
run!(args, test_translation).unwrap();
49+
run_with_tcx!(args, test_translation).unwrap();
4950
}
5051

5152
fn generate_input(path: &str) -> std::io::Result<()> {

0 commit comments

Comments
 (0)