Skip to content

Commit ca9f57f

Browse files
committed
move rustc_smir to driver
1 parent 98c1e3d commit ca9f57f

File tree

12 files changed

+19
-65
lines changed

12 files changed

+19
-65
lines changed

Diff for: Cargo.lock

+1-17
Original file line numberDiff line numberDiff line change
@@ -3346,8 +3346,6 @@ dependencies = [
33463346
"rustc_codegen_ssa",
33473347
"rustc_driver",
33483348
"rustc_driver_impl",
3349-
"rustc_smir",
3350-
"stable_mir",
33513349
]
33523350

33533351
[[package]]
@@ -3770,6 +3768,7 @@ dependencies = [
37703768
"rustc_trait_selection",
37713769
"rustc_ty_utils",
37723770
"serde_json",
3771+
"stable_mir",
37733772
"time",
37743773
"tracing",
37753774
"windows",
@@ -4500,21 +4499,6 @@ dependencies = [
45004499
"windows",
45014500
]
45024501

4503-
[[package]]
4504-
name = "rustc_smir"
4505-
version = "0.0.0"
4506-
dependencies = [
4507-
"rustc_data_structures",
4508-
"rustc_driver",
4509-
"rustc_hir",
4510-
"rustc_interface",
4511-
"rustc_middle",
4512-
"rustc_span",
4513-
"rustc_target",
4514-
"stable_mir",
4515-
"tracing",
4516-
]
4517-
45184502
[[package]]
45194503
name = "rustc_span"
45204504
version = "0.0.0"

Diff for: compiler/rustc/Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ rustc_driver_impl = { path = "../rustc_driver_impl" }
1010
# Make sure rustc_codegen_ssa ends up in the sysroot, because this
1111
# crate is intended to be used by codegen backends, which may not be in-tree.
1212
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
13-
# Make sure rustc_smir ends up in the sysroot, because this
14-
# crate is intended to be used by stable MIR consumers, which are not in-tree
15-
rustc_smir = { path = "../rustc_smir" }
16-
stable_mir = { path = "../stable_mir" }
13+
1714

1815
[dependencies.jemalloc-sys]
1916
version = "0.5.0"

Diff for: compiler/rustc_driver_impl/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rustc_ast = { path = "../rustc_ast" }
5353
rustc_span = { path = "../rustc_span" }
5454
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
5555
rustc_mir_transform = { path = "../rustc_mir_transform" }
56+
stable_mir = {path = "../stable_mir"}
5657

5758
[target.'cfg(unix)'.dependencies]
5859
libc = "0.2"

Diff for: compiler/rustc_driver_impl/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ use {do_not_use_print as print, do_not_use_print as println};
8585

8686
pub mod args;
8787
pub mod pretty;
88+
pub mod rustc_internal;
89+
pub mod rustc_smir;
8890
#[macro_use]
8991
mod print;
9092
mod session_diagnostics;

Diff for: compiler/rustc_smir/src/rustc_internal/mod.rs renamed to compiler/rustc_driver_impl/src/rustc_internal/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
66
use crate::rustc_internal;
77
use crate::rustc_smir::Tables;
8+
use crate::{catch_fatal_errors, Callbacks, Compilation, RunCompiler};
89
use rustc_data_structures::fx;
9-
use rustc_driver::{Callbacks, Compilation, RunCompiler};
1010
use rustc_interface::{interface, Queries};
1111
use rustc_middle::mir::interpret::AllocId;
1212
use rustc_middle::ty::TyCtxt;
@@ -150,7 +150,7 @@ where
150150
/// Runs the compiler against given target and tests it with `test_function`
151151
pub fn run(&mut self) -> Result<C, CompilerError<B>> {
152152
let compiler_result =
153-
rustc_driver::catch_fatal_errors(|| RunCompiler::new(&self.args.clone(), self).run());
153+
catch_fatal_errors(|| RunCompiler::new(&self.args.clone(), self).run());
154154
match (compiler_result, self.result.take()) {
155155
(Ok(Ok(())), Some(ControlFlow::Continue(value))) => Ok(value),
156156
(Ok(Ok(())), Some(ControlFlow::Break(value))) => Err(CompilerError::Interrupted(value)),

Diff for: compiler/rustc_smir/src/rustc_smir/mod.rs renamed to compiler/rustc_driver_impl/src/rustc_smir/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//! The WIP stable interface to rustc internals.
2+
//!
3+
//! For more information see <https://github.com/rust-lang/project-stable-mir>
4+
//!
5+
//! # Note
6+
//!
7+
//! This API is still completely unstable and subject to change.
8+
19
//! Module that implements what will become the rustc side of Stable MIR.
210
311
//! This module is responsible for building Stable MIR components from internal components.

Diff for: compiler/rustc_smir/.gitignore

-1
This file was deleted.

Diff for: compiler/rustc_smir/Cargo.toml

-17
This file was deleted.

Diff for: compiler/rustc_smir/src/lib.rs

-20
This file was deleted.

Diff for: tests/ui-fulldeps/stable-mir/compilation-result.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#![feature(assert_matches)]
1111

1212
extern crate rustc_middle;
13-
extern crate rustc_smir;
13+
extern crate rustc_driver;
1414
extern crate stable_mir;
1515

1616
use rustc_middle::ty::TyCtxt;
17-
use rustc_smir::rustc_internal;
17+
use rustc_driver::rustc_internal;
1818
use std::io::Write;
1919
use std::ops::ControlFlow;
2020

Diff for: tests/ui-fulldeps/stable-mir/crate-info.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
extern crate rustc_hir;
1414
extern crate rustc_middle;
15-
extern crate rustc_smir;
15+
extern crate rustc_driver;
1616
extern crate stable_mir;
1717

1818
use rustc_hir::def::DefKind;
1919
use rustc_middle::ty::TyCtxt;
20-
use rustc_smir::rustc_internal;
20+
use rustc_driver::rustc_internal;
2121

2222
use stable_mir::fold::Foldable;
2323
use std::assert_matches::assert_matches;

0 commit comments

Comments
 (0)