use RustcPublic instead of StableMir

This commit is contained in:
Makai 2025-07-15 16:37:26 +00:00
parent 483877a9b2
commit 4d79328091
23 changed files with 28 additions and 28 deletions

View file

@ -191,7 +191,7 @@ macro_rules! run_driver {
use rustc_public::CompilerError;
use std::ops::ControlFlow;
pub struct StableMir<B = (), C = (), F = fn($($crate::optional!($with_tcx TyCtxt))?) -> ControlFlow<B, C>>
pub struct RustcPublic<B = (), C = (), F = fn($($crate::optional!($with_tcx TyCtxt))?) -> ControlFlow<B, C>>
where
B: Send,
C: Send,
@ -201,15 +201,15 @@ macro_rules! run_driver {
result: Option<ControlFlow<B, C>>,
}
impl<B, C, F> StableMir<B, C, F>
impl<B, C, F> RustcPublic<B, C, F>
where
B: Send,
C: Send,
F: FnOnce($($crate::optional!($with_tcx TyCtxt))?) -> ControlFlow<B, C> + Send,
{
/// Creates a new `StableMir` instance, with given test_function and arguments.
/// Creates a new `RustcPublic` instance, with given test_function and arguments.
pub fn new(callback: F) -> Self {
StableMir { callback: Some(callback), result: None }
RustcPublic { callback: Some(callback), result: None }
}
/// Runs the compiler against given target and tests it with `test_function`
@ -236,7 +236,7 @@ macro_rules! run_driver {
}
}
impl<B, C, F> Callbacks for StableMir<B, C, F>
impl<B, C, F> Callbacks for RustcPublic<B, C, F>
where
B: Send,
C: Send,
@ -265,6 +265,6 @@ macro_rules! run_driver {
}
}
StableMir::new($callback).run($args)
RustcPublic::new($callback).run($args)
}};
}

View file

@ -167,7 +167,7 @@ impl MirVisitor for AdtDefVisitor {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "alloc_input.rs";

View file

@ -202,7 +202,7 @@ fn get_item<'a>(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "alloc_input.rs";

View file

@ -52,7 +52,7 @@ fn get_item<'a>(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "attribute_input.rs";

View file

@ -76,7 +76,7 @@ impl<'a> MirVisitor for Visitor<'a> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "binop_input.rs";

View file

@ -79,7 +79,7 @@ fn contains<T: CrateDef + std::fmt::Debug>(items: &[T], expected: &[&str]) {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "crate_definitions.rs";

View file

@ -70,7 +70,7 @@ fn check_fn_def(ty: Ty) {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "defs_ty_input.rs";

View file

@ -106,7 +106,7 @@ fn get_instances(body: mir::Body) -> Vec<Instance> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "defs_input.rs";

View file

@ -52,7 +52,7 @@ fn test_foreign() -> ControlFlow<()> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "foreign_input.rs";

View file

@ -81,7 +81,7 @@ fn test_body(body: mir::Body) {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "instance_input.rs";

View file

@ -110,7 +110,7 @@ impl<'a> MirVisitor for CallsVisitor<'a> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "binop_input.rs";

View file

@ -41,7 +41,7 @@ fn test_item_kind() -> ControlFlow<()> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "item_kind_input.rs";

View file

@ -55,7 +55,7 @@ fn check_ty(ty: Ty) {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "normalization_input.rs";

View file

@ -67,7 +67,7 @@ fn assert_impl(impl_names: &HashSet<String>, target: &str) {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "trait_queries.rs";

View file

@ -115,7 +115,7 @@ fn get_item<'a>(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "transform_input.rs";

View file

@ -73,7 +73,7 @@ impl<'a> MirVisitor for PlaceVisitor<'a> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "ty_fold_input.rs";

View file

@ -120,7 +120,7 @@ fn check_statement_is_aggregate_assign(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "defs_ty_input.rs";

View file

@ -20,7 +20,7 @@ use std::io::Write;
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "input_compilation_result_test.rs";

View file

@ -189,7 +189,7 @@ fn get_item<'a>(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "input.rs";

View file

@ -141,7 +141,7 @@ fn get_item<'a>(
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "input.rs";

View file

@ -34,7 +34,7 @@ fn test_translation(tcx: TyCtxt<'_>) -> ControlFlow<()> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "internal_input.rs";

View file

@ -41,7 +41,7 @@ fn serialize_to_json(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "internal_input.rs";

View file

@ -177,7 +177,7 @@ impl mir::MutMirVisitor for TestMutVisitor {
/// This test will generate and analyze a dummy crate using the stable mir.
/// For that, it will first write the dummy crate into a file.
/// Then it will create a `StableMir` using custom arguments and then
/// Then it will create a `RustcPublic` using custom arguments and then
/// it will run the compiler.
fn main() {
let path = "sim_visitor_input.rs";