Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split rustc_mir #80522

Merged
merged 7 commits into from Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
119 changes: 102 additions & 17 deletions Cargo.lock
Expand Up @@ -3598,6 +3598,33 @@ dependencies = [
"rustc_span",
]

[[package]]
name = "rustc_borrowck"
version = "0.0.0"
dependencies = [
"either",
"itertools 0.9.0",
"polonius-engine",
"rustc_const_eval",
"rustc_data_structures",
"rustc_errors",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_lexer",
"rustc_middle",
"rustc_mir_dataflow",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"rustc_traits",
"smallvec",
"tracing",
]

[[package]]
name = "rustc_builtin_macros"
version = "0.0.0"
Expand Down Expand Up @@ -3681,6 +3708,30 @@ dependencies = [
"tracing",
]

[[package]]
name = "rustc_const_eval"
version = "0.0.0"
dependencies = [
"either",
"gsgdt",
"rustc_apfloat",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_macros",
"rustc_middle",
"rustc_mir_dataflow",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"tracing",
]

[[package]]
name = "rustc_data_structures"
version = "0.0.0"
Expand Down Expand Up @@ -3719,6 +3770,7 @@ dependencies = [
"rustc_ast",
"rustc_ast_pretty",
"rustc_codegen_ssa",
"rustc_const_eval",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
Expand All @@ -3729,7 +3781,6 @@ dependencies = [
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_parse",
"rustc_plugin_impl",
"rustc_save_analysis",
Expand Down Expand Up @@ -3888,9 +3939,11 @@ dependencies = [
"rustc_ast_lowering",
"rustc_ast_passes",
"rustc_attr",
"rustc_borrowck",
"rustc_builtin_macros",
"rustc_codegen_llvm",
"rustc_codegen_ssa",
"rustc_const_eval",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
Expand All @@ -3899,8 +3952,9 @@ dependencies = [
"rustc_lint",
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_mir_build",
"rustc_mir_transform",
"rustc_monomorphize",
"rustc_parse",
"rustc_passes",
"rustc_plugin_impl",
Expand Down Expand Up @@ -4018,6 +4072,8 @@ version = "0.0.0"
dependencies = [
"bitflags",
"chalk-ir",
"either",
"gsgdt",
"polonius-engine",
"rustc-rayon-core",
"rustc_apfloat",
Expand All @@ -4027,6 +4083,7 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
"rustc_macros",
Expand All @@ -4041,51 +4098,63 @@ dependencies = [
]

[[package]]
name = "rustc_mir"
name = "rustc_mir_build"
version = "0.0.0"
dependencies = [
"coverage_test_macros",
"either",
"gsgdt",
"itertools 0.9.0",
"polonius-engine",
"regex",
"rustc_apfloat",
"rustc_arena",
"rustc_ast",
"rustc_attr",
"rustc_data_structures",
"rustc_errors",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_lexer",
"rustc_macros",
"rustc_middle",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"rustc_traits",
"smallvec",
"tracing",
]

[[package]]
name = "rustc_mir_build"
name = "rustc_mir_dataflow"
version = "0.0.0"
dependencies = [
"rustc_apfloat",
"rustc_arena",
"polonius-engine",
"regex",
"rustc_ast",
"rustc_data_structures",
"rustc_graphviz",
"rustc_hir",
"rustc_index",
"rustc_middle",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"smallvec",
"tracing",
]

[[package]]
name = "rustc_mir_transform"
version = "0.0.0"
dependencies = [
"coverage_test_macros",
"itertools 0.9.0",
"rustc_ast",
"rustc_attr",
"rustc_const_eval",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_infer",
"rustc_middle",
"rustc_mir_dataflow",
"rustc_serialize",
"rustc_session",
"rustc_span",
Expand All @@ -4095,6 +4164,22 @@ dependencies = [
"tracing",
]

[[package]]
name = "rustc_monomorphize"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
"smallvec",
"tracing",
]

[[package]]
name = "rustc_parse"
version = "0.0.0"
Expand Down
@@ -1,5 +1,5 @@
[package]
name = "rustc_mir"
name = "rustc_borrowck"
version = "0.0.0"
edition = "2018"

Expand All @@ -8,30 +8,23 @@ doctest = false

[dependencies]
either = "1.5.0"
rustc_graphviz = { path = "../rustc_graphviz" }
gsgdt = "0.1.2"
itertools = "0.9"
tracing = "0.1"
polonius-engine = "0.13.0"
regex = "1"
rustc_middle = { path = "../rustc_middle" }
rustc_attr = { path = "../rustc_attr" }
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_graphviz = { path = "../rustc_graphviz" }
rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" }
rustc_infer = { path = "../rustc_infer" }
rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" }
rustc_const_eval = { path = "../rustc_const_eval" }
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_traits = { path = "../rustc_traits" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
rustc_apfloat = { path = "../rustc_apfloat" }
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }

[dev-dependencies]
coverage_test_macros = { path = "src/transform/coverage/test_macros" }
@@ -1,14 +1,14 @@
use crate::borrow_check::nll::ToRegionVid;
use crate::borrow_check::path_utils::allow_two_phase_borrow;
use crate::borrow_check::place_ext::PlaceExt;
use crate::dataflow::indexes::BorrowIndex;
use crate::dataflow::move_paths::MoveData;
use crate::nll::ToRegionVid;
use crate::path_utils::allow_two_phase_borrow;
use crate::place_ext::PlaceExt;
use crate::BorrowIndex;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_index::bit_set::BitSet;
use rustc_middle::mir::traversal;
use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor};
use rustc_middle::mir::{self, Body, Local, Location};
use rustc_middle::ty::{RegionVid, TyCtxt};
use rustc_mir_dataflow::move_paths::MoveData;
use std::fmt;
use std::ops::Index;

Expand Down
Expand Up @@ -2,7 +2,7 @@ use rustc_errors::{struct_span_err, DiagnosticBuilder, DiagnosticId};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::{MultiSpan, Span};

impl<'cx, 'tcx> crate::borrow_check::MirBorrowckCtxt<'cx, 'tcx> {
impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
crate fn cannot_move_when_borrowed(&self, span: Span, desc: &str) -> DiagnosticBuilder<'cx> {
struct_span_err!(self, span, E0505, "cannot move out of {} because it is borrowed", desc,)
}
Expand Down
Expand Up @@ -9,7 +9,7 @@ use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{self, RegionVid, Ty};

use crate::borrow_check::{
use crate::{
borrow_set::BorrowSet, facts::AllFacts, location::LocationTable, nll::ToRegionVid,
places_conflict, region_infer::values::LivenessValues,
};
Expand Down
Expand Up @@ -4,7 +4,7 @@ use rustc_middle::mir::ConstraintCategory;
use rustc_middle::ty::{RegionVid, VarianceDiagInfo};
use rustc_span::DUMMY_SP;

use crate::borrow_check::{
use crate::{
constraints::OutlivesConstraintIndex,
constraints::{OutlivesConstraint, OutlivesConstraintSet},
type_check::Locations,
Expand Down
Expand Up @@ -5,7 +5,7 @@ use rustc_middle::ty::{RegionVid, VarianceDiagInfo};
use std::fmt;
use std::ops::Index;

use crate::borrow_check::type_check::Locations;
use crate::type_check::Locations;

crate mod graph;

Expand Down