about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-29 15:24:45 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2020-03-30 07:02:56 +0200
commit7710f2dd5cdb812763b7c7e7a35f3184c647315e (patch)
tree7d156cb85991006dd4c90074357b5ab40d0ba1e3
parent0afdf43dc1d9be4c8b422840166b51dd99e56a16 (diff)
downloadrust-7710f2dd5cdb812763b7c7e7a35f3184c647315e.tar.gz
rust-7710f2dd5cdb812763b7c7e7a35f3184c647315e.zip
rustc -> rustc_middle part 1
-rw-r--r--Cargo.lock106
-rw-r--r--src/libcore/clone.rs2
-rw-r--r--src/libcore/marker.rs2
-rw-r--r--src/librustc_ast/entry.rs2
-rw-r--r--src/librustc_ast/expand/mod.rs2
-rw-r--r--src/librustc_ast/lib.rs2
-rw-r--r--src/librustc_ast_lowering/lib.rs2
-rw-r--r--src/librustc_codegen_llvm/Cargo.toml2
-rw-r--r--src/librustc_codegen_ssa/Cargo.toml2
-rw-r--r--src/librustc_data_structures/lib.rs2
-rw-r--r--src/librustc_driver/Cargo.toml2
-rw-r--r--src/librustc_error_codes/error_codes/E0264.md2
-rw-r--r--src/librustc_errors/lib.rs2
-rw-r--r--src/librustc_hir/stable_hash_impls.rs2
-rw-r--r--src/librustc_incremental/Cargo.toml2
-rw-r--r--src/librustc_incremental/lib.rs2
-rw-r--r--src/librustc_infer/Cargo.toml2
-rw-r--r--src/librustc_infer/lib.rs2
-rw-r--r--src/librustc_interface/Cargo.toml2
-rw-r--r--src/librustc_interface/callbacks.rs8
-rw-r--r--src/librustc_lint/Cargo.toml2
-rw-r--r--src/librustc_lint/builtin.rs2
-rw-r--r--src/librustc_metadata/Cargo.toml2
-rw-r--r--src/librustc_metadata/lib.rs2
-rw-r--r--src/librustc_middle/Cargo.toml (renamed from src/librustc/Cargo.toml)4
-rw-r--r--src/librustc_middle/README.md (renamed from src/librustc/README.md)0
-rw-r--r--src/librustc_middle/arena.rs (renamed from src/librustc/arena.rs)0
-rw-r--r--src/librustc_middle/benches/lib.rs (renamed from src/librustc/benches/lib.rs)0
-rw-r--r--src/librustc_middle/build.rs (renamed from src/librustc/build.rs)0
-rw-r--r--src/librustc_middle/dep_graph/dep_node.rs (renamed from src/librustc/dep_graph/dep_node.rs)0
-rw-r--r--src/librustc_middle/dep_graph/mod.rs (renamed from src/librustc/dep_graph/mod.rs)0
-rw-r--r--src/librustc_middle/hir/exports.rs (renamed from src/librustc/hir/exports.rs)0
-rw-r--r--src/librustc_middle/hir/map/blocks.rs (renamed from src/librustc/hir/map/blocks.rs)0
-rw-r--r--src/librustc_middle/hir/map/collector.rs (renamed from src/librustc/hir/map/collector.rs)0
-rw-r--r--src/librustc_middle/hir/map/mod.rs (renamed from src/librustc/hir/map/mod.rs)0
-rw-r--r--src/librustc_middle/hir/mod.rs (renamed from src/librustc/hir/mod.rs)0
-rw-r--r--src/librustc_middle/ich/hcx.rs (renamed from src/librustc/ich/hcx.rs)0
-rw-r--r--src/librustc_middle/ich/impls_hir.rs (renamed from src/librustc/ich/impls_hir.rs)0
-rw-r--r--src/librustc_middle/ich/impls_syntax.rs (renamed from src/librustc/ich/impls_syntax.rs)0
-rw-r--r--src/librustc_middle/ich/impls_ty.rs (renamed from src/librustc/ich/impls_ty.rs)0
-rw-r--r--src/librustc_middle/ich/mod.rs (renamed from src/librustc/ich/mod.rs)0
-rw-r--r--src/librustc_middle/infer/canonical.rs (renamed from src/librustc/infer/canonical.rs)0
-rw-r--r--src/librustc_middle/infer/mod.rs (renamed from src/librustc/infer/mod.rs)0
-rw-r--r--src/librustc_middle/infer/unify_key.rs (renamed from src/librustc/infer/unify_key.rs)0
-rw-r--r--src/librustc_middle/lib.rs (renamed from src/librustc/lib.rs)2
-rw-r--r--src/librustc_middle/lint.rs (renamed from src/librustc/lint.rs)0
-rw-r--r--src/librustc_middle/macros.rs (renamed from src/librustc/macros.rs)0
-rw-r--r--src/librustc_middle/middle/codegen_fn_attrs.rs (renamed from src/librustc/middle/codegen_fn_attrs.rs)0
-rw-r--r--src/librustc_middle/middle/cstore.rs (renamed from src/librustc/middle/cstore.rs)0
-rw-r--r--src/librustc_middle/middle/dependency_format.rs (renamed from src/librustc/middle/dependency_format.rs)0
-rw-r--r--src/librustc_middle/middle/exported_symbols.rs (renamed from src/librustc/middle/exported_symbols.rs)0
-rw-r--r--src/librustc_middle/middle/free_region.rs (renamed from src/librustc/middle/free_region.rs)0
-rw-r--r--src/librustc_middle/middle/lang_items.rs (renamed from src/librustc/middle/lang_items.rs)0
-rw-r--r--src/librustc_middle/middle/limits.rs (renamed from src/librustc/middle/limits.rs)0
-rw-r--r--src/librustc_middle/middle/mod.rs (renamed from src/librustc/middle/mod.rs)0
-rw-r--r--src/librustc_middle/middle/privacy.rs (renamed from src/librustc/middle/privacy.rs)0
-rw-r--r--src/librustc_middle/middle/region.rs (renamed from src/librustc/middle/region.rs)0
-rw-r--r--src/librustc_middle/middle/resolve_lifetime.rs (renamed from src/librustc/middle/resolve_lifetime.rs)0
-rw-r--r--src/librustc_middle/middle/stability.rs (renamed from src/librustc/middle/stability.rs)0
-rw-r--r--src/librustc_middle/mir/cache.rs (renamed from src/librustc/mir/cache.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/allocation.rs (renamed from src/librustc/mir/interpret/allocation.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/error.rs (renamed from src/librustc/mir/interpret/error.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/mod.rs (renamed from src/librustc/mir/interpret/mod.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/pointer.rs (renamed from src/librustc/mir/interpret/pointer.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/queries.rs (renamed from src/librustc/mir/interpret/queries.rs)0
-rw-r--r--src/librustc_middle/mir/interpret/value.rs (renamed from src/librustc/mir/interpret/value.rs)0
-rw-r--r--src/librustc_middle/mir/mod.rs (renamed from src/librustc/mir/mod.rs)0
-rw-r--r--src/librustc_middle/mir/mono.rs (renamed from src/librustc/mir/mono.rs)0
-rw-r--r--src/librustc_middle/mir/query.rs (renamed from src/librustc/mir/query.rs)0
-rw-r--r--src/librustc_middle/mir/tcx.rs (renamed from src/librustc/mir/tcx.rs)0
-rw-r--r--src/librustc_middle/mir/traversal.rs (renamed from src/librustc/mir/traversal.rs)0
-rw-r--r--src/librustc_middle/mir/type_foldable.rs (renamed from src/librustc/mir/type_foldable.rs)0
-rw-r--r--src/librustc_middle/mir/visit.rs (renamed from src/librustc/mir/visit.rs)0
-rw-r--r--src/librustc_middle/query/mod.rs (renamed from src/librustc/query/mod.rs)0
-rw-r--r--src/librustc_middle/tests.rs (renamed from src/librustc/tests.rs)2
-rw-r--r--src/librustc_middle/traits/mod.rs (renamed from src/librustc/traits/mod.rs)0
-rw-r--r--src/librustc_middle/traits/query.rs (renamed from src/librustc/traits/query.rs)0
-rw-r--r--src/librustc_middle/traits/select.rs (renamed from src/librustc/traits/select.rs)0
-rw-r--r--src/librustc_middle/traits/specialization_graph.rs (renamed from src/librustc/traits/specialization_graph.rs)0
-rw-r--r--src/librustc_middle/traits/structural_impls.rs (renamed from src/librustc/traits/structural_impls.rs)0
-rw-r--r--src/librustc_middle/ty/_match.rs (renamed from src/librustc/ty/_match.rs)0
-rw-r--r--src/librustc_middle/ty/adjustment.rs (renamed from src/librustc/ty/adjustment.rs)0
-rw-r--r--src/librustc_middle/ty/binding.rs (renamed from src/librustc/ty/binding.rs)0
-rw-r--r--src/librustc_middle/ty/cast.rs (renamed from src/librustc/ty/cast.rs)0
-rw-r--r--src/librustc_middle/ty/codec.rs (renamed from src/librustc/ty/codec.rs)0
-rw-r--r--src/librustc_middle/ty/context.rs (renamed from src/librustc/ty/context.rs)0
-rw-r--r--src/librustc_middle/ty/diagnostics.rs (renamed from src/librustc/ty/diagnostics.rs)0
-rw-r--r--src/librustc_middle/ty/erase_regions.rs (renamed from src/librustc/ty/erase_regions.rs)0
-rw-r--r--src/librustc_middle/ty/error.rs (renamed from src/librustc/ty/error.rs)0
-rw-r--r--src/librustc_middle/ty/fast_reject.rs (renamed from src/librustc/ty/fast_reject.rs)0
-rw-r--r--src/librustc_middle/ty/flags.rs (renamed from src/librustc/ty/flags.rs)0
-rw-r--r--src/librustc_middle/ty/fold.rs (renamed from src/librustc/ty/fold.rs)0
-rw-r--r--src/librustc_middle/ty/free_region_map.rs (renamed from src/librustc/ty/free_region_map.rs)0
-rw-r--r--src/librustc_middle/ty/inhabitedness/def_id_forest.rs (renamed from src/librustc/ty/inhabitedness/def_id_forest.rs)0
-rw-r--r--src/librustc_middle/ty/inhabitedness/mod.rs (renamed from src/librustc/ty/inhabitedness/mod.rs)0
-rw-r--r--src/librustc_middle/ty/instance.rs (renamed from src/librustc/ty/instance.rs)0
-rw-r--r--src/librustc_middle/ty/layout.rs (renamed from src/librustc/ty/layout.rs)0
-rw-r--r--src/librustc_middle/ty/mod.rs (renamed from src/librustc/ty/mod.rs)0
-rw-r--r--src/librustc_middle/ty/normalize_erasing_regions.rs (renamed from src/librustc/ty/normalize_erasing_regions.rs)0
-rw-r--r--src/librustc_middle/ty/outlives.rs (renamed from src/librustc/ty/outlives.rs)0
-rw-r--r--src/librustc_middle/ty/print/mod.rs (renamed from src/librustc/ty/print/mod.rs)0
-rw-r--r--src/librustc_middle/ty/print/obsolete.rs (renamed from src/librustc/ty/print/obsolete.rs)0
-rw-r--r--src/librustc_middle/ty/print/pretty.rs (renamed from src/librustc/ty/print/pretty.rs)0
-rw-r--r--src/librustc_middle/ty/query/README.md (renamed from src/librustc/ty/query/README.md)0
-rw-r--r--src/librustc_middle/ty/query/job.rs (renamed from src/librustc/ty/query/job.rs)0
-rw-r--r--src/librustc_middle/ty/query/keys.rs (renamed from src/librustc/ty/query/keys.rs)0
-rw-r--r--src/librustc_middle/ty/query/mod.rs (renamed from src/librustc/ty/query/mod.rs)0
-rw-r--r--src/librustc_middle/ty/query/on_disk_cache.rs (renamed from src/librustc/ty/query/on_disk_cache.rs)0
-rw-r--r--src/librustc_middle/ty/query/plumbing.rs (renamed from src/librustc/ty/query/plumbing.rs)0
-rw-r--r--src/librustc_middle/ty/query/profiling_support.rs (renamed from src/librustc/ty/query/profiling_support.rs)0
-rw-r--r--src/librustc_middle/ty/query/stats.rs (renamed from src/librustc/ty/query/stats.rs)0
-rw-r--r--src/librustc_middle/ty/query/values.rs (renamed from src/librustc/ty/query/values.rs)0
-rw-r--r--src/librustc_middle/ty/relate.rs (renamed from src/librustc/ty/relate.rs)0
-rw-r--r--src/librustc_middle/ty/steal.rs (renamed from src/librustc/ty/steal.rs)0
-rw-r--r--src/librustc_middle/ty/structural_impls.rs (renamed from src/librustc/ty/structural_impls.rs)0
-rw-r--r--src/librustc_middle/ty/sty.rs (renamed from src/librustc/ty/sty.rs)0
-rw-r--r--src/librustc_middle/ty/subst.rs (renamed from src/librustc/ty/subst.rs)0
-rw-r--r--src/librustc_middle/ty/trait_def.rs (renamed from src/librustc/ty/trait_def.rs)0
-rw-r--r--src/librustc_middle/ty/util.rs (renamed from src/librustc/ty/util.rs)0
-rw-r--r--src/librustc_middle/ty/walk.rs (renamed from src/librustc/ty/walk.rs)0
-rw-r--r--src/librustc_middle/util/bug.rs (renamed from src/librustc/util/bug.rs)0
-rw-r--r--src/librustc_middle/util/common.rs (renamed from src/librustc/util/common.rs)0
-rw-r--r--src/librustc_middle/util/common/tests.rs (renamed from src/librustc/util/common/tests.rs)0
-rw-r--r--src/librustc_mir/Cargo.toml2
-rw-r--r--src/librustc_mir/const_eval/error.rs2
-rw-r--r--src/librustc_mir/interpret/intrinsics.rs2
-rw-r--r--src/librustc_mir_build/Cargo.toml2
-rw-r--r--src/librustc_passes/Cargo.toml2
-rw-r--r--src/librustc_passes/stability.rs2
-rw-r--r--src/librustc_plugin_impl/Cargo.toml2
-rw-r--r--src/librustc_privacy/Cargo.toml2
-rw-r--r--src/librustc_query_system/dep_graph/dep_node.rs2
-rw-r--r--src/librustc_query_system/query/config.rs4
-rw-r--r--src/librustc_resolve/Cargo.toml2
-rw-r--r--src/librustc_save_analysis/Cargo.toml2
-rw-r--r--src/librustc_session/filesearch.rs2
-rw-r--r--src/librustc_session/lint.rs2
-rw-r--r--src/librustc_span/lib.rs2
-rw-r--r--src/librustc_symbol_mangling/Cargo.toml2
-rw-r--r--src/librustc_target/lib.rs2
-rw-r--r--src/librustc_trait_selection/Cargo.toml2
-rw-r--r--src/librustc_traits/Cargo.toml2
-rw-r--r--src/librustc_ty/Cargo.toml2
-rw-r--r--src/librustc_typeck/Cargo.toml2
-rw-r--r--src/librustc_typeck/check/generator_interior.rs2
-rw-r--r--src/librustdoc/core.rs2
-rw-r--r--src/libstd/alloc.rs2
147 files changed, 109 insertions, 107 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fdc84e53d12..e8b21a247b2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3133,39 +3133,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "rustc"
-version = "0.0.0"
-dependencies = [
- "arena",
- "backtrace",
- "bitflags",
- "byteorder",
- "jobserver",
- "log",
- "measureme",
- "parking_lot 0.10.0",
- "polonius-engine",
- "rustc-rayon",
- "rustc-rayon-core",
- "rustc_apfloat",
- "rustc_ast",
- "rustc_attr",
- "rustc_data_structures",
- "rustc_errors",
- "rustc_feature",
- "rustc_hir",
- "rustc_index",
- "rustc_macros",
- "rustc_query_system",
- "rustc_session",
- "rustc_span",
- "rustc_target",
- "scoped-tls",
- "serialize",
- "smallvec 1.0.0",
-]
-
-[[package]]
 name = "rustc-ap-arena"
 version = "642.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3603,7 +3570,6 @@ dependencies = [
  "libc",
  "log",
  "measureme",
- "rustc",
  "rustc-demangle",
  "rustc_ast",
  "rustc_attr",
@@ -3616,6 +3582,7 @@ dependencies = [
  "rustc_incremental",
  "rustc_index",
  "rustc_llvm",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -3634,7 +3601,6 @@ dependencies = [
  "log",
  "memmap",
  "num_cpus",
- "rustc",
  "rustc_apfloat",
  "rustc_ast",
  "rustc_attr",
@@ -3645,6 +3611,7 @@ dependencies = [
  "rustc_incremental",
  "rustc_index",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_symbol_mangling",
@@ -3685,7 +3652,6 @@ dependencies = [
  "env_logger 0.7.1",
  "lazy_static 1.4.0",
  "log",
- "rustc",
  "rustc_ast",
  "rustc_ast_pretty",
  "rustc_codegen_ssa",
@@ -3698,6 +3664,7 @@ dependencies = [
  "rustc_interface",
  "rustc_lint",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_mir",
  "rustc_parse",
  "rustc_plugin_impl",
@@ -3797,11 +3764,11 @@ dependencies = [
  "graphviz",
  "log",
  "rand 0.7.3",
- "rustc",
  "rustc_ast",
  "rustc_data_structures",
  "rustc_fs_util",
  "rustc_hir",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "serialize",
@@ -3821,13 +3788,13 @@ version = "0.0.0"
 dependencies = [
  "graphviz",
  "log",
- "rustc",
  "rustc_ast",
  "rustc_data_structures",
  "rustc_errors",
  "rustc_hir",
  "rustc_index",
  "rustc_macros",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -3840,7 +3807,6 @@ version = "0.0.0"
 dependencies = [
  "log",
  "once_cell",
- "rustc",
  "rustc-rayon",
  "rustc_ast",
  "rustc_ast_lowering",
@@ -3857,6 +3823,7 @@ dependencies = [
  "rustc_infer",
  "rustc_lint",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_mir",
  "rustc_mir_build",
  "rustc_parse",
@@ -3890,7 +3857,6 @@ name = "rustc_lint"
 version = "0.0.0"
 dependencies = [
  "log",
- "rustc",
  "rustc_ast",
  "rustc_ast_pretty",
  "rustc_attr",
@@ -3900,6 +3866,7 @@ dependencies = [
  "rustc_hir",
  "rustc_index",
  "rustc_infer",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -3933,7 +3900,6 @@ dependencies = [
  "flate2",
  "log",
  "memmap",
- "rustc",
  "rustc_ast",
  "rustc_attr",
  "rustc_data_structures",
@@ -3942,6 +3908,7 @@ dependencies = [
  "rustc_hir",
  "rustc_hir_pretty",
  "rustc_index",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -3952,6 +3919,39 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustc_middle"
+version = "0.0.0"
+dependencies = [
+ "arena",
+ "backtrace",
+ "bitflags",
+ "byteorder",
+ "jobserver",
+ "log",
+ "measureme",
+ "parking_lot 0.10.0",
+ "polonius-engine",
+ "rustc-rayon",
+ "rustc-rayon-core",
+ "rustc_apfloat",
+ "rustc_ast",
+ "rustc_attr",
+ "rustc_data_structures",
+ "rustc_errors",
+ "rustc_feature",
+ "rustc_hir",
+ "rustc_index",
+ "rustc_macros",
+ "rustc_query_system",
+ "rustc_session",
+ "rustc_span",
+ "rustc_target",
+ "scoped-tls",
+ "serialize",
+ "smallvec 1.0.0",
+]
+
+[[package]]
 name = "rustc_mir"
 version = "0.0.0"
 dependencies = [
@@ -3961,7 +3961,6 @@ dependencies = [
  "log",
  "log_settings",
  "polonius-engine",
- "rustc",
  "rustc_apfloat",
  "rustc_ast",
  "rustc_ast_pretty",
@@ -3973,6 +3972,7 @@ dependencies = [
  "rustc_infer",
  "rustc_lexer",
  "rustc_macros",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -3987,7 +3987,6 @@ version = "0.0.0"
 dependencies = [
  "arena",
  "log",
- "rustc",
  "rustc_apfloat",
  "rustc_ast",
  "rustc_attr",
@@ -3997,6 +3996,7 @@ dependencies = [
  "rustc_index",
  "rustc_infer",
  "rustc_macros",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -4028,7 +4028,6 @@ name = "rustc_passes"
 version = "0.0.0"
 dependencies = [
  "log",
- "rustc",
  "rustc_ast",
  "rustc_attr",
  "rustc_data_structures",
@@ -4037,6 +4036,7 @@ dependencies = [
  "rustc_hir",
  "rustc_index",
  "rustc_infer",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -4047,12 +4047,12 @@ dependencies = [
 name = "rustc_plugin_impl"
 version = "0.0.0"
 dependencies = [
- "rustc",
  "rustc_ast",
  "rustc_errors",
  "rustc_hir",
  "rustc_lint",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
 ]
@@ -4062,12 +4062,12 @@ name = "rustc_privacy"
 version = "0.0.0"
 dependencies = [
  "log",
- "rustc",
  "rustc_ast",
  "rustc_attr",
  "rustc_data_structures",
  "rustc_errors",
  "rustc_hir",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_typeck",
@@ -4096,7 +4096,6 @@ dependencies = [
  "arena",
  "bitflags",
  "log",
- "rustc",
  "rustc_ast",
  "rustc_ast_lowering",
  "rustc_ast_pretty",
@@ -4107,6 +4106,7 @@ dependencies = [
  "rustc_feature",
  "rustc_hir",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "smallvec 1.0.0",
@@ -4119,12 +4119,12 @@ dependencies = [
  "log",
  "rls-data",
  "rls-span",
- "rustc",
  "rustc_ast",
  "rustc_ast_pretty",
  "rustc_data_structures",
  "rustc_hir",
  "rustc_hir_pretty",
+ "rustc_middle",
  "rustc_parse",
  "rustc_session",
  "rustc_span",
@@ -4169,12 +4169,12 @@ version = "0.0.0"
 dependencies = [
  "log",
  "punycode",
- "rustc",
  "rustc-demangle",
  "rustc_ast",
  "rustc_data_structures",
  "rustc_hir",
  "rustc_metadata",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -4209,7 +4209,6 @@ version = "0.0.0"
 dependencies = [
  "fmt_macros",
  "log",
- "rustc",
  "rustc_ast",
  "rustc_attr",
  "rustc_data_structures",
@@ -4218,6 +4217,7 @@ dependencies = [
  "rustc_index",
  "rustc_infer",
  "rustc_macros",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -4229,12 +4229,12 @@ name = "rustc_traits"
 version = "0.0.0"
 dependencies = [
  "log",
- "rustc",
  "rustc_ast",
  "rustc_data_structures",
  "rustc_hir",
  "rustc_infer",
  "rustc_macros",
+ "rustc_middle",
  "rustc_span",
  "rustc_target",
  "rustc_trait_selection",
@@ -4246,10 +4246,10 @@ name = "rustc_ty"
 version = "0.0.0"
 dependencies = [
  "log",
- "rustc",
  "rustc_data_structures",
  "rustc_hir",
  "rustc_infer",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
@@ -4262,7 +4262,6 @@ version = "0.0.0"
 dependencies = [
  "arena",
  "log",
- "rustc",
  "rustc_ast",
  "rustc_attr",
  "rustc_data_structures",
@@ -4270,6 +4269,7 @@ dependencies = [
  "rustc_hir",
  "rustc_index",
  "rustc_infer",
+ "rustc_middle",
  "rustc_session",
  "rustc_span",
  "rustc_target",
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs
index eb101fc72fd..9cc0109069e 100644
--- a/src/libcore/clone.rs
+++ b/src/libcore/clone.rs
@@ -169,7 +169,7 @@ pub struct AssertParamIsCopy<T: Copy + ?Sized> {
 /// Implementations of `Clone` for primitive types.
 ///
 /// Implementations that cannot be described in Rust
-/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
+/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
 mod impls {
 
     use super::Clone;
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index b131cf84e18..9b13766e9c4 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -759,7 +759,7 @@ impl<T: ?Sized> Unpin for *mut T {}
 /// Implementations of `Copy` for primitive types.
 ///
 /// Implementations that cannot be described in Rust
-/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
+/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc_middle.
 mod copy_impls {
 
     use super::Copy;
diff --git a/src/librustc_ast/entry.rs b/src/librustc_ast/entry.rs
index 0a72019bfe9..90d417a45fd 100644
--- a/src/librustc_ast/entry.rs
+++ b/src/librustc_ast/entry.rs
@@ -10,7 +10,7 @@ pub enum EntryPointType {
     OtherMain, // Not an entry point, but some other function named main
 }
 
-// Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
+// Beware, this is duplicated in librustc_middle/middle/entry.rs, make sure to keep
 // them in sync.
 pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
     match item.kind {
diff --git a/src/librustc_ast/expand/mod.rs b/src/librustc_ast/expand/mod.rs
index 50df8fa39ed..3c634ff40cc 100644
--- a/src/librustc_ast/expand/mod.rs
+++ b/src/librustc_ast/expand/mod.rs
@@ -1,4 +1,4 @@
-//! Definitions shared by macros / syntax extensions and e.g. librustc.
+//! Definitions shared by macros / syntax extensions and e.g. librustc_middle.
 
 use crate::ast::Attribute;
 use rustc_span::symbol::sym;
diff --git a/src/librustc_ast/lib.rs b/src/librustc_ast/lib.rs
index a93e0fcbd71..1687f828f24 100644
--- a/src/librustc_ast/lib.rs
+++ b/src/librustc_ast/lib.rs
@@ -54,7 +54,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 
 /// Requirements for a `StableHashingContext` to be used in this crate.
 /// This is a hack to allow using the `HashStable_Generic` derive macro
-/// instead of implementing everything in librustc.
+/// instead of implementing everything in librustc_middle.
 pub trait HashStableContext: rustc_span::HashStableContext {
     fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
 }
diff --git a/src/librustc_ast_lowering/lib.rs b/src/librustc_ast_lowering/lib.rs
index 45ee7265c15..9028edc73a0 100644
--- a/src/librustc_ast_lowering/lib.rs
+++ b/src/librustc_ast_lowering/lib.rs
@@ -97,7 +97,7 @@ struct LoweringContext<'a, 'hir: 'a> {
 
     /// HACK(Centril): there is a cyclic dependency between the parser and lowering
     /// if we don't have this function pointer. To avoid that dependency so that
-    /// librustc is independent of the parser, we use dynamic dispatch here.
+    /// librustc_middle is independent of the parser, we use dynamic dispatch here.
     nt_to_tokenstream: NtToTokenstream,
 
     /// Used to allocate HIR nodes
diff --git a/src/librustc_codegen_llvm/Cargo.toml b/src/librustc_codegen_llvm/Cargo.toml
index 16ed0854abe..64e66595d92 100644
--- a/src/librustc_codegen_llvm/Cargo.toml
+++ b/src/librustc_codegen_llvm/Cargo.toml
@@ -16,7 +16,7 @@ flate2 = "1.0"
 libc = "0.2"
 measureme = "0.7.1"
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc-demangle = "0.1"
 rustc_attr = { path = "../librustc_attr" }
 rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
diff --git a/src/librustc_codegen_ssa/Cargo.toml b/src/librustc_codegen_ssa/Cargo.toml
index 299f4d2c669..717e32d4a0d 100644
--- a/src/librustc_codegen_ssa/Cargo.toml
+++ b/src/librustc_codegen_ssa/Cargo.toml
@@ -22,7 +22,7 @@ tempfile = "3.1"
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 rustc_ast = { path = "../librustc_ast" }
 rustc_span = { path = "../librustc_span" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_apfloat = { path = "../librustc_apfloat" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_symbol_mangling = { path = "../librustc_symbol_mangling" }
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index f9f8ff5303e..ba82e58d7a9 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -114,6 +114,6 @@ impl<F: Fn()> Drop for OnDrop<F> {
     }
 }
 
-// See comments in src/librustc/lib.rs
+// See comments in src/librustc_middle/lib.rs
 #[doc(hidden)]
 pub fn __noop_fix_for_27438() {}
diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml
index 3ca39b24c52..652f16c2e08 100644
--- a/src/librustc_driver/Cargo.toml
+++ b/src/librustc_driver/Cargo.toml
@@ -13,7 +13,7 @@ crate-type = ["dylib"]
 lazy_static = "1.0"
 log = "0.4"
 env_logger = { version = "0.7", default-features = false }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_target = { path = "../librustc_target" }
 rustc_lint = { path = "../librustc_lint" }
diff --git a/src/librustc_error_codes/error_codes/E0264.md b/src/librustc_error_codes/error_codes/E0264.md
index 708eac8837a..e2a27f7b106 100644
--- a/src/librustc_error_codes/error_codes/E0264.md
+++ b/src/librustc_error_codes/error_codes/E0264.md
@@ -12,7 +12,7 @@ extern "C" {
 ```
 
 A list of available external lang items is available in
-`src/librustc/middle/weak_lang_items.rs`. Example:
+`src/librustc_middle/middle/weak_lang_items.rs`. Example:
 
 ```
 #![feature(lang_items)]
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 6157c46f80c..204fea58c95 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -425,7 +425,7 @@ impl Handler {
     }
 
     // This is here to not allow mutation of flags;
-    // as of this writing it's only used in tests in librustc.
+    // as of this writing it's only used in tests in librustc_middle.
     pub fn can_emit_warnings(&self) -> bool {
         self.flags.can_emit_warnings
     }
diff --git a/src/librustc_hir/stable_hash_impls.rs b/src/librustc_hir/stable_hash_impls.rs
index 996b3108969..1d3f44a0899 100644
--- a/src/librustc_hir/stable_hash_impls.rs
+++ b/src/librustc_hir/stable_hash_impls.rs
@@ -9,7 +9,7 @@ use rustc_span::def_id::{DefPathHash, LocalDefId};
 
 /// Requirements for a `StableHashingContext` to be used in this crate.
 /// This is a hack to allow using the `HashStable_Generic` derive macro
-/// instead of implementing everything in librustc.
+/// instead of implementing everything in librustc_middle.
 pub trait HashStableContext:
     rustc_ast::HashStableContext + rustc_target::HashStableContext
 {
diff --git a/src/librustc_incremental/Cargo.toml b/src/librustc_incremental/Cargo.toml
index eddfb81ea8b..5caf1d411e6 100644
--- a/src/librustc_incremental/Cargo.toml
+++ b/src/librustc_incremental/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
 graphviz = { path = "../libgraphviz" }
 log = "0.4"
 rand = "0.7"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs
index ca824fde7ef..dd715c6c81d 100644
--- a/src/librustc_incremental/lib.rs
+++ b/src/librustc_incremental/lib.rs
@@ -6,7 +6,7 @@
 #![recursion_limit = "256"]
 
 #[macro_use]
-extern crate rustc;
+extern crate rustc_middle;
 #[macro_use]
 extern crate log;
 
diff --git a/src/librustc_infer/Cargo.toml b/src/librustc_infer/Cargo.toml
index 9ecd056430c..bc4080ac6c8 100644
--- a/src/librustc_infer/Cargo.toml
+++ b/src/librustc_infer/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
 [dependencies]
 graphviz = { path = "../libgraphviz" }
 log = { version = "0.4", features = ["release_max_level_info", "std"] }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
diff --git a/src/librustc_infer/lib.rs b/src/librustc_infer/lib.rs
index cb8ae8c592b..5dd5165b688 100644
--- a/src/librustc_infer/lib.rs
+++ b/src/librustc_infer/lib.rs
@@ -30,7 +30,7 @@ extern crate rustc_data_structures;
 #[macro_use]
 extern crate log;
 #[macro_use]
-extern crate rustc;
+extern crate rustc_middle;
 
 pub mod infer;
 pub mod traits;
diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml
index 2e055ff183f..c9d81e51641 100644
--- a/src/librustc_interface/Cargo.toml
+++ b/src/librustc_interface/Cargo.toml
@@ -21,7 +21,7 @@ rustc_parse = { path = "../librustc_parse" }
 rustc_session = { path = "../librustc_session" }
 rustc_span = { path = "../librustc_span" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast_lowering = { path = "../librustc_ast_lowering" }
 rustc_ast_passes = { path = "../librustc_ast_passes" }
 rustc_incremental = { path = "../librustc_incremental" }
diff --git a/src/librustc_interface/callbacks.rs b/src/librustc_interface/callbacks.rs
index 0345b82d3bb..6fb56b785af 100644
--- a/src/librustc_interface/callbacks.rs
+++ b/src/librustc_interface/callbacks.rs
@@ -1,6 +1,6 @@
 //! Throughout the compiler tree, there are several places which want to have
 //! access to state or queries while being inside crates that are dependencies
-//! of librustc. To facilitate this, we have the
+//! of librustc_middle. To facilitate this, we have the
 //! `rustc_data_structures::AtomicRef` type, which allows us to setup a global
 //! static which can then be set in this file at program startup.
 //!
@@ -14,7 +14,7 @@ use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS};
 use std::fmt;
 
 /// This is a callback from librustc_ast as it cannot access the implicit state
-/// in librustc otherwise.
+/// in librustc_middle otherwise.
 fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     tls::with_opt(|tcx| {
         if let Some(tcx) = tcx {
@@ -26,7 +26,7 @@ fn span_debug(span: rustc_span::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result
 }
 
 /// This is a callback from librustc_ast as it cannot access the implicit state
-/// in librustc otherwise. It is used to when diagnostic messages are
+/// in librustc_middle otherwise. It is used to when diagnostic messages are
 /// emitted and stores them in the current query, if there is one.
 fn track_diagnostic(diagnostic: &Diagnostic) {
     tls::with_context_opt(|icx| {
@@ -40,7 +40,7 @@ fn track_diagnostic(diagnostic: &Diagnostic) {
 }
 
 /// This is a callback from librustc_hir as it cannot access the implicit state
-/// in librustc otherwise.
+/// in librustc_middle otherwise.
 fn def_id_debug(def_id: rustc_hir::def_id::DefId, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     write!(f, "DefId({}:{}", def_id.krate, def_id.index.index())?;
     tls::with_opt(|opt_tcx| {
diff --git a/src/librustc_lint/Cargo.toml b/src/librustc_lint/Cargo.toml
index 9785af5eab2..44a5ba3de51 100644
--- a/src/librustc_lint/Cargo.toml
+++ b/src/librustc_lint/Cargo.toml
@@ -11,7 +11,7 @@ path = "lib.rs"
 [dependencies]
 log = "0.4"
 unicode-security = "0.0.2"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_errors = { path = "../librustc_errors" }
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index 906e46edfe7..aee194d490f 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -50,7 +50,7 @@ use crate::nonstandard_style::{method_context, MethodLateContext};
 use log::debug;
 use std::fmt::Write;
 
-// hardwired lints from librustc
+// hardwired lints from librustc_middle
 pub use rustc_session::lint::builtin::*;
 
 declare_lint! {
diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml
index ea439b1f41d..a88ccd52e91 100644
--- a/src/librustc_metadata/Cargo.toml
+++ b/src/librustc_metadata/Cargo.toml
@@ -14,7 +14,7 @@ flate2 = "1.0"
 log = "0.4"
 memmap = "0.7"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_errors = { path = "../librustc_errors" }
diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs
index 2993aed2f8a..22a2bf28041 100644
--- a/src/librustc_metadata/lib.rs
+++ b/src/librustc_metadata/lib.rs
@@ -14,7 +14,7 @@ extern crate libc;
 extern crate proc_macro;
 
 #[macro_use]
-extern crate rustc;
+extern crate rustc_middle;
 #[macro_use]
 extern crate rustc_data_structures;
 
diff --git a/src/librustc/Cargo.toml b/src/librustc_middle/Cargo.toml
index 1dd742c3549..dd322b9da95 100644
--- a/src/librustc/Cargo.toml
+++ b/src/librustc_middle/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
 authors = ["The Rust Project Developers"]
-name = "rustc"
+name = "rustc_middle"
 version = "0.0.0"
 edition = "2018"
 
 [lib]
-name = "rustc"
+name = "rustc_middle"
 path = "lib.rs"
 doctest = false
 
diff --git a/src/librustc/README.md b/src/librustc_middle/README.md
index de58f546cd3..de58f546cd3 100644
--- a/src/librustc/README.md
+++ b/src/librustc_middle/README.md
diff --git a/src/librustc/arena.rs b/src/librustc_middle/arena.rs
index ae542cec170..ae542cec170 100644
--- a/src/librustc/arena.rs
+++ b/src/librustc_middle/arena.rs
diff --git a/src/librustc/benches/lib.rs b/src/librustc_middle/benches/lib.rs
index 237751bcbd7..237751bcbd7 100644
--- a/src/librustc/benches/lib.rs
+++ b/src/librustc_middle/benches/lib.rs
diff --git a/src/librustc/build.rs b/src/librustc_middle/build.rs
index af7723aea34..af7723aea34 100644
--- a/src/librustc/build.rs
+++ b/src/librustc_middle/build.rs
diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc_middle/dep_graph/dep_node.rs
index f4a4aab844c..f4a4aab844c 100644
--- a/src/librustc/dep_graph/dep_node.rs
+++ b/src/librustc_middle/dep_graph/dep_node.rs
diff --git a/src/librustc/dep_graph/mod.rs b/src/librustc_middle/dep_graph/mod.rs
index f56df19bfb0..f56df19bfb0 100644
--- a/src/librustc/dep_graph/mod.rs
+++ b/src/librustc_middle/dep_graph/mod.rs
diff --git a/src/librustc/hir/exports.rs b/src/librustc_middle/hir/exports.rs
index 4c144a54d63..4c144a54d63 100644
--- a/src/librustc/hir/exports.rs
+++ b/src/librustc_middle/hir/exports.rs
diff --git a/src/librustc/hir/map/blocks.rs b/src/librustc_middle/hir/map/blocks.rs
index 7024e86f95d..7024e86f95d 100644
--- a/src/librustc/hir/map/blocks.rs
+++ b/src/librustc_middle/hir/map/blocks.rs
diff --git a/src/librustc/hir/map/collector.rs b/src/librustc_middle/hir/map/collector.rs
index 70ea856498d..70ea856498d 100644
--- a/src/librustc/hir/map/collector.rs
+++ b/src/librustc_middle/hir/map/collector.rs
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc_middle/hir/map/mod.rs
index e8ce13e06e9..e8ce13e06e9 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc_middle/hir/map/mod.rs
diff --git a/src/librustc/hir/mod.rs b/src/librustc_middle/hir/mod.rs
index ce8e1f48daa..ce8e1f48daa 100644
--- a/src/librustc/hir/mod.rs
+++ b/src/librustc_middle/hir/mod.rs
diff --git a/src/librustc/ich/hcx.rs b/src/librustc_middle/ich/hcx.rs
index d58aa383667..d58aa383667 100644
--- a/src/librustc/ich/hcx.rs
+++ b/src/librustc_middle/ich/hcx.rs
diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc_middle/ich/impls_hir.rs
index f668cc99754..f668cc99754 100644
--- a/src/librustc/ich/impls_hir.rs
+++ b/src/librustc_middle/ich/impls_hir.rs
diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc_middle/ich/impls_syntax.rs
index c5a4b53b10d..c5a4b53b10d 100644
--- a/src/librustc/ich/impls_syntax.rs
+++ b/src/librustc_middle/ich/impls_syntax.rs
diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc_middle/ich/impls_ty.rs
index 41cc8cbaebb..41cc8cbaebb 100644
--- a/src/librustc/ich/impls_ty.rs
+++ b/src/librustc_middle/ich/impls_ty.rs
diff --git a/src/librustc/ich/mod.rs b/src/librustc_middle/ich/mod.rs
index 516e3ed979c..516e3ed979c 100644
--- a/src/librustc/ich/mod.rs
+++ b/src/librustc_middle/ich/mod.rs
diff --git a/src/librustc/infer/canonical.rs b/src/librustc_middle/infer/canonical.rs
index 5f7e8c84965..5f7e8c84965 100644
--- a/src/librustc/infer/canonical.rs
+++ b/src/librustc_middle/infer/canonical.rs
diff --git a/src/librustc/infer/mod.rs b/src/librustc_middle/infer/mod.rs
index 497d3811f28..497d3811f28 100644
--- a/src/librustc/infer/mod.rs
+++ b/src/librustc_middle/infer/mod.rs
diff --git a/src/librustc/infer/unify_key.rs b/src/librustc_middle/infer/unify_key.rs
index e205453a48c..e205453a48c 100644
--- a/src/librustc/infer/unify_key.rs
+++ b/src/librustc_middle/infer/unify_key.rs
diff --git a/src/librustc/lib.rs b/src/librustc_middle/lib.rs
index 6f18560a02d..f9d9ce1f312 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc_middle/lib.rs
@@ -93,4 +93,6 @@ pub mod util {
 }
 
 // Allows macros to refer to this crate as `::rustc`
+// FIXME(Centril): maybe change this at some point if `rustc_middle`
+// is something we're going with long-term.
 extern crate self as rustc;
diff --git a/src/librustc/lint.rs b/src/librustc_middle/lint.rs
index 53061436de0..53061436de0 100644
--- a/src/librustc/lint.rs
+++ b/src/librustc_middle/lint.rs
diff --git a/src/librustc/macros.rs b/src/librustc_middle/macros.rs
index 88ddd96eec8..88ddd96eec8 100644
--- a/src/librustc/macros.rs
+++ b/src/librustc_middle/macros.rs
diff --git a/src/librustc/middle/codegen_fn_attrs.rs b/src/librustc_middle/middle/codegen_fn_attrs.rs
index 61b25cc4864..61b25cc4864 100644
--- a/src/librustc/middle/codegen_fn_attrs.rs
+++ b/src/librustc_middle/middle/codegen_fn_attrs.rs
diff --git a/src/librustc/middle/cstore.rs b/src/librustc_middle/middle/cstore.rs
index 012390e8f74..012390e8f74 100644
--- a/src/librustc/middle/cstore.rs
+++ b/src/librustc_middle/middle/cstore.rs
diff --git a/src/librustc/middle/dependency_format.rs b/src/librustc_middle/middle/dependency_format.rs
index ee5f822d313..ee5f822d313 100644
--- a/src/librustc/middle/dependency_format.rs
+++ b/src/librustc_middle/middle/dependency_format.rs
diff --git a/src/librustc/middle/exported_symbols.rs b/src/librustc_middle/middle/exported_symbols.rs
index 1f4318fa537..1f4318fa537 100644
--- a/src/librustc/middle/exported_symbols.rs
+++ b/src/librustc_middle/middle/exported_symbols.rs
diff --git a/src/librustc/middle/free_region.rs b/src/librustc_middle/middle/free_region.rs
index 62ccd946744..62ccd946744 100644
--- a/src/librustc/middle/free_region.rs
+++ b/src/librustc_middle/middle/free_region.rs
diff --git a/src/librustc/middle/lang_items.rs b/src/librustc_middle/middle/lang_items.rs
index 36560371587..36560371587 100644
--- a/src/librustc/middle/lang_items.rs
+++ b/src/librustc_middle/middle/lang_items.rs
diff --git a/src/librustc/middle/limits.rs b/src/librustc_middle/middle/limits.rs
index 6de53c703e1..6de53c703e1 100644
--- a/src/librustc/middle/limits.rs
+++ b/src/librustc_middle/middle/limits.rs
diff --git a/src/librustc/middle/mod.rs b/src/librustc_middle/middle/mod.rs
index 464488964af..464488964af 100644
--- a/src/librustc/middle/mod.rs
+++ b/src/librustc_middle/middle/mod.rs
diff --git a/src/librustc/middle/privacy.rs b/src/librustc_middle/middle/privacy.rs
index 4756e83b5e9..4756e83b5e9 100644
--- a/src/librustc/middle/privacy.rs
+++ b/src/librustc_middle/middle/privacy.rs
diff --git a/src/librustc/middle/region.rs b/src/librustc_middle/middle/region.rs
index 73251ee2680..73251ee2680 100644
--- a/src/librustc/middle/region.rs
+++ b/src/librustc_middle/middle/region.rs
diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc_middle/middle/resolve_lifetime.rs
index c21ba1b3bd2..c21ba1b3bd2 100644
--- a/src/librustc/middle/resolve_lifetime.rs
+++ b/src/librustc_middle/middle/resolve_lifetime.rs
diff --git a/src/librustc/middle/stability.rs b/src/librustc_middle/middle/stability.rs
index 46525bdedad..46525bdedad 100644
--- a/src/librustc/middle/stability.rs
+++ b/src/librustc_middle/middle/stability.rs
diff --git a/src/librustc/mir/cache.rs b/src/librustc_middle/mir/cache.rs
index 00ecc7a7a0a..00ecc7a7a0a 100644
--- a/src/librustc/mir/cache.rs
+++ b/src/librustc_middle/mir/cache.rs
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc_middle/mir/interpret/allocation.rs
index ada02ceb5cb..ada02ceb5cb 100644
--- a/src/librustc/mir/interpret/allocation.rs
+++ b/src/librustc_middle/mir/interpret/allocation.rs
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc_middle/mir/interpret/error.rs
index c46ab89d004..c46ab89d004 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc_middle/mir/interpret/error.rs
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc_middle/mir/interpret/mod.rs
index 10c3a06da08..10c3a06da08 100644
--- a/src/librustc/mir/interpret/mod.rs
+++ b/src/librustc_middle/mir/interpret/mod.rs
diff --git a/src/librustc/mir/interpret/pointer.rs b/src/librustc_middle/mir/interpret/pointer.rs
index d22207bd816..d22207bd816 100644
--- a/src/librustc/mir/interpret/pointer.rs
+++ b/src/librustc_middle/mir/interpret/pointer.rs
diff --git a/src/librustc/mir/interpret/queries.rs b/src/librustc_middle/mir/interpret/queries.rs
index 46bf1d96957..46bf1d96957 100644
--- a/src/librustc/mir/interpret/queries.rs
+++ b/src/librustc_middle/mir/interpret/queries.rs
diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc_middle/mir/interpret/value.rs
index bf4ee848823..bf4ee848823 100644
--- a/src/librustc/mir/interpret/value.rs
+++ b/src/librustc_middle/mir/interpret/value.rs
diff --git a/src/librustc/mir/mod.rs b/src/librustc_middle/mir/mod.rs
index 9ba9d816d0f..9ba9d816d0f 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc_middle/mir/mod.rs
diff --git a/src/librustc/mir/mono.rs b/src/librustc_middle/mir/mono.rs
index 0b64cb479d5..0b64cb479d5 100644
--- a/src/librustc/mir/mono.rs
+++ b/src/librustc_middle/mir/mono.rs
diff --git a/src/librustc/mir/query.rs b/src/librustc_middle/mir/query.rs
index 8c81f5227d2..8c81f5227d2 100644
--- a/src/librustc/mir/query.rs
+++ b/src/librustc_middle/mir/query.rs
diff --git a/src/librustc/mir/tcx.rs b/src/librustc_middle/mir/tcx.rs
index feb66319267..feb66319267 100644
--- a/src/librustc/mir/tcx.rs
+++ b/src/librustc_middle/mir/tcx.rs
diff --git a/src/librustc/mir/traversal.rs b/src/librustc_middle/mir/traversal.rs
index ed8129b1e09..ed8129b1e09 100644
--- a/src/librustc/mir/traversal.rs
+++ b/src/librustc_middle/mir/traversal.rs
diff --git a/src/librustc/mir/type_foldable.rs b/src/librustc_middle/mir/type_foldable.rs
index 9520f081b6b..9520f081b6b 100644
--- a/src/librustc/mir/type_foldable.rs
+++ b/src/librustc_middle/mir/type_foldable.rs
diff --git a/src/librustc/mir/visit.rs b/src/librustc_middle/mir/visit.rs
index 400d15cdc14..400d15cdc14 100644
--- a/src/librustc/mir/visit.rs
+++ b/src/librustc_middle/mir/visit.rs
diff --git a/src/librustc/query/mod.rs b/src/librustc_middle/query/mod.rs
index c1ece627509..c1ece627509 100644
--- a/src/librustc/query/mod.rs
+++ b/src/librustc_middle/query/mod.rs
diff --git a/src/librustc/tests.rs b/src/librustc_middle/tests.rs
index cf3ea2ffa93..757e0bd3bfb 100644
--- a/src/librustc/tests.rs
+++ b/src/librustc_middle/tests.rs
@@ -1,6 +1,6 @@
 use super::*;
 
-// FIXME(#27438): right now the unit tests of librustc don't refer to any actual
+// FIXME(#27438): right now the unit tests of librustc_middle don't refer to any actual
 //                functions generated in librustc_data_structures (all
 //                references are through generic functions), but statics are
 //                referenced from time to time. Due to this bug we won't
diff --git a/src/librustc/traits/mod.rs b/src/librustc_middle/traits/mod.rs
index c129b574fd3..c129b574fd3 100644
--- a/src/librustc/traits/mod.rs
+++ b/src/librustc_middle/traits/mod.rs
diff --git a/src/librustc/traits/query.rs b/src/librustc_middle/traits/query.rs
index 67f4b15f919..67f4b15f919 100644
--- a/src/librustc/traits/query.rs
+++ b/src/librustc_middle/traits/query.rs
diff --git a/src/librustc/traits/select.rs b/src/librustc_middle/traits/select.rs
index d316d7659e2..d316d7659e2 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc_middle/traits/select.rs
diff --git a/src/librustc/traits/specialization_graph.rs b/src/librustc_middle/traits/specialization_graph.rs
index 1847326a742..1847326a742 100644
--- a/src/librustc/traits/specialization_graph.rs
+++ b/src/librustc_middle/traits/specialization_graph.rs
diff --git a/src/librustc/traits/structural_impls.rs b/src/librustc_middle/traits/structural_impls.rs
index b1fb02a67b3..b1fb02a67b3 100644
--- a/src/librustc/traits/structural_impls.rs
+++ b/src/librustc_middle/traits/structural_impls.rs
diff --git a/src/librustc/ty/_match.rs b/src/librustc_middle/ty/_match.rs
index 35f8eb20475..35f8eb20475 100644
--- a/src/librustc/ty/_match.rs
+++ b/src/librustc_middle/ty/_match.rs
diff --git a/src/librustc/ty/adjustment.rs b/src/librustc_middle/ty/adjustment.rs
index 851bffc2065..851bffc2065 100644
--- a/src/librustc/ty/adjustment.rs
+++ b/src/librustc_middle/ty/adjustment.rs
diff --git a/src/librustc/ty/binding.rs b/src/librustc_middle/ty/binding.rs
index 5ee88115090..5ee88115090 100644
--- a/src/librustc/ty/binding.rs
+++ b/src/librustc_middle/ty/binding.rs
diff --git a/src/librustc/ty/cast.rs b/src/librustc_middle/ty/cast.rs
index 31c106cb230..31c106cb230 100644
--- a/src/librustc/ty/cast.rs
+++ b/src/librustc_middle/ty/cast.rs
diff --git a/src/librustc/ty/codec.rs b/src/librustc_middle/ty/codec.rs
index cbbc937ed7d..cbbc937ed7d 100644
--- a/src/librustc/ty/codec.rs
+++ b/src/librustc_middle/ty/codec.rs
diff --git a/src/librustc/ty/context.rs b/src/librustc_middle/ty/context.rs
index 0ab91d7e112..0ab91d7e112 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc_middle/ty/context.rs
diff --git a/src/librustc/ty/diagnostics.rs b/src/librustc_middle/ty/diagnostics.rs
index d1eb21e25ff..d1eb21e25ff 100644
--- a/src/librustc/ty/diagnostics.rs
+++ b/src/librustc_middle/ty/diagnostics.rs
diff --git a/src/librustc/ty/erase_regions.rs b/src/librustc_middle/ty/erase_regions.rs
index 4bf08096ede..4bf08096ede 100644
--- a/src/librustc/ty/erase_regions.rs
+++ b/src/librustc_middle/ty/erase_regions.rs
diff --git a/src/librustc/ty/error.rs b/src/librustc_middle/ty/error.rs
index d0bc0d5fabf..d0bc0d5fabf 100644
--- a/src/librustc/ty/error.rs
+++ b/src/librustc_middle/ty/error.rs
diff --git a/src/librustc/ty/fast_reject.rs b/src/librustc_middle/ty/fast_reject.rs
index 2a937d6581d..2a937d6581d 100644
--- a/src/librustc/ty/fast_reject.rs
+++ b/src/librustc_middle/ty/fast_reject.rs
diff --git a/src/librustc/ty/flags.rs b/src/librustc_middle/ty/flags.rs
index 5243e1fbf57..5243e1fbf57 100644
--- a/src/librustc/ty/flags.rs
+++ b/src/librustc_middle/ty/flags.rs
diff --git a/src/librustc/ty/fold.rs b/src/librustc_middle/ty/fold.rs
index 3f4f2407f1e..3f4f2407f1e 100644
--- a/src/librustc/ty/fold.rs
+++ b/src/librustc_middle/ty/fold.rs
diff --git a/src/librustc/ty/free_region_map.rs b/src/librustc_middle/ty/free_region_map.rs
index 2ab12a4acbf..2ab12a4acbf 100644
--- a/src/librustc/ty/free_region_map.rs
+++ b/src/librustc_middle/ty/free_region_map.rs
diff --git a/src/librustc/ty/inhabitedness/def_id_forest.rs b/src/librustc_middle/ty/inhabitedness/def_id_forest.rs
index 14ead77653c..14ead77653c 100644
--- a/src/librustc/ty/inhabitedness/def_id_forest.rs
+++ b/src/librustc_middle/ty/inhabitedness/def_id_forest.rs
diff --git a/src/librustc/ty/inhabitedness/mod.rs b/src/librustc_middle/ty/inhabitedness/mod.rs
index b166c4dea0c..b166c4dea0c 100644
--- a/src/librustc/ty/inhabitedness/mod.rs
+++ b/src/librustc_middle/ty/inhabitedness/mod.rs
diff --git a/src/librustc/ty/instance.rs b/src/librustc_middle/ty/instance.rs
index fcfee0fea85..fcfee0fea85 100644
--- a/src/librustc/ty/instance.rs
+++ b/src/librustc_middle/ty/instance.rs
diff --git a/src/librustc/ty/layout.rs b/src/librustc_middle/ty/layout.rs
index bfe9ed200a1..bfe9ed200a1 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc_middle/ty/layout.rs
diff --git a/src/librustc/ty/mod.rs b/src/librustc_middle/ty/mod.rs
index 43982439d47..43982439d47 100644
--- a/src/librustc/ty/mod.rs
+++ b/src/librustc_middle/ty/mod.rs
diff --git a/src/librustc/ty/normalize_erasing_regions.rs b/src/librustc_middle/ty/normalize_erasing_regions.rs
index 2f0a57c59eb..2f0a57c59eb 100644
--- a/src/librustc/ty/normalize_erasing_regions.rs
+++ b/src/librustc_middle/ty/normalize_erasing_regions.rs
diff --git a/src/librustc/ty/outlives.rs b/src/librustc_middle/ty/outlives.rs
index 9dd96f2f2b5..9dd96f2f2b5 100644
--- a/src/librustc/ty/outlives.rs
+++ b/src/librustc_middle/ty/outlives.rs
diff --git a/src/librustc/ty/print/mod.rs b/src/librustc_middle/ty/print/mod.rs
index a932f334dde..a932f334dde 100644
--- a/src/librustc/ty/print/mod.rs
+++ b/src/librustc_middle/ty/print/mod.rs
diff --git a/src/librustc/ty/print/obsolete.rs b/src/librustc_middle/ty/print/obsolete.rs
index 7605d44c7f3..7605d44c7f3 100644
--- a/src/librustc/ty/print/obsolete.rs
+++ b/src/librustc_middle/ty/print/obsolete.rs
diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc_middle/ty/print/pretty.rs
index b1626d95eb3..b1626d95eb3 100644
--- a/src/librustc/ty/print/pretty.rs
+++ b/src/librustc_middle/ty/print/pretty.rs
diff --git a/src/librustc/ty/query/README.md b/src/librustc_middle/ty/query/README.md
index 8ec07b9fdeb..8ec07b9fdeb 100644
--- a/src/librustc/ty/query/README.md
+++ b/src/librustc_middle/ty/query/README.md
diff --git a/src/librustc/ty/query/job.rs b/src/librustc_middle/ty/query/job.rs
index 5f7a9e81158..5f7a9e81158 100644
--- a/src/librustc/ty/query/job.rs
+++ b/src/librustc_middle/ty/query/job.rs
diff --git a/src/librustc/ty/query/keys.rs b/src/librustc_middle/ty/query/keys.rs
index a261e484a85..a261e484a85 100644
--- a/src/librustc/ty/query/keys.rs
+++ b/src/librustc_middle/ty/query/keys.rs
diff --git a/src/librustc/ty/query/mod.rs b/src/librustc_middle/ty/query/mod.rs
index 744237520fb..744237520fb 100644
--- a/src/librustc/ty/query/mod.rs
+++ b/src/librustc_middle/ty/query/mod.rs
diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc_middle/ty/query/on_disk_cache.rs
index 8aecc0e698a..8aecc0e698a 100644
--- a/src/librustc/ty/query/on_disk_cache.rs
+++ b/src/librustc_middle/ty/query/on_disk_cache.rs
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc_middle/ty/query/plumbing.rs
index 1bb392f436f..1bb392f436f 100644
--- a/src/librustc/ty/query/plumbing.rs
+++ b/src/librustc_middle/ty/query/plumbing.rs
diff --git a/src/librustc/ty/query/profiling_support.rs b/src/librustc_middle/ty/query/profiling_support.rs
index e0d3e764dad..e0d3e764dad 100644
--- a/src/librustc/ty/query/profiling_support.rs
+++ b/src/librustc_middle/ty/query/profiling_support.rs
diff --git a/src/librustc/ty/query/stats.rs b/src/librustc_middle/ty/query/stats.rs
index b496bf839ab..b496bf839ab 100644
--- a/src/librustc/ty/query/stats.rs
+++ b/src/librustc_middle/ty/query/stats.rs
diff --git a/src/librustc/ty/query/values.rs b/src/librustc_middle/ty/query/values.rs
index b01d15c29b2..b01d15c29b2 100644
--- a/src/librustc/ty/query/values.rs
+++ b/src/librustc_middle/ty/query/values.rs
diff --git a/src/librustc/ty/relate.rs b/src/librustc_middle/ty/relate.rs
index 5ff77d073d3..5ff77d073d3 100644
--- a/src/librustc/ty/relate.rs
+++ b/src/librustc_middle/ty/relate.rs
diff --git a/src/librustc/ty/steal.rs b/src/librustc_middle/ty/steal.rs
index 224e76845d7..224e76845d7 100644
--- a/src/librustc/ty/steal.rs
+++ b/src/librustc_middle/ty/steal.rs
diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc_middle/ty/structural_impls.rs
index 429791d09a4..429791d09a4 100644
--- a/src/librustc/ty/structural_impls.rs
+++ b/src/librustc_middle/ty/structural_impls.rs
diff --git a/src/librustc/ty/sty.rs b/src/librustc_middle/ty/sty.rs
index d440e84e15c..d440e84e15c 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc_middle/ty/sty.rs
diff --git a/src/librustc/ty/subst.rs b/src/librustc_middle/ty/subst.rs
index 0f4485a7050..0f4485a7050 100644
--- a/src/librustc/ty/subst.rs
+++ b/src/librustc_middle/ty/subst.rs
diff --git a/src/librustc/ty/trait_def.rs b/src/librustc_middle/ty/trait_def.rs
index ed9054fcffd..ed9054fcffd 100644
--- a/src/librustc/ty/trait_def.rs
+++ b/src/librustc_middle/ty/trait_def.rs
diff --git a/src/librustc/ty/util.rs b/src/librustc_middle/ty/util.rs
index dab367a6639..dab367a6639 100644
--- a/src/librustc/ty/util.rs
+++ b/src/librustc_middle/ty/util.rs
diff --git a/src/librustc/ty/walk.rs b/src/librustc_middle/ty/walk.rs
index da08fbcf144..da08fbcf144 100644
--- a/src/librustc/ty/walk.rs
+++ b/src/librustc_middle/ty/walk.rs
diff --git a/src/librustc/util/bug.rs b/src/librustc_middle/util/bug.rs
index 54cd8a29f94..54cd8a29f94 100644
--- a/src/librustc/util/bug.rs
+++ b/src/librustc_middle/util/bug.rs
diff --git a/src/librustc/util/common.rs b/src/librustc_middle/util/common.rs
index 19b43bfd162..19b43bfd162 100644
--- a/src/librustc/util/common.rs
+++ b/src/librustc_middle/util/common.rs
diff --git a/src/librustc/util/common/tests.rs b/src/librustc_middle/util/common/tests.rs
index 9a9fb203c62..9a9fb203c62 100644
--- a/src/librustc/util/common/tests.rs
+++ b/src/librustc_middle/util/common/tests.rs
diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml
index 256a80076b9..f9b195e92eb 100644
--- a/src/librustc_mir/Cargo.toml
+++ b/src/librustc_mir/Cargo.toml
@@ -16,7 +16,7 @@ itertools = "0.8"
 log = "0.4"
 log_settings = "0.1.1"
 polonius-engine = "0.12.0"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_data_structures = { path = "../librustc_data_structures" }
diff --git a/src/librustc_mir/const_eval/error.rs b/src/librustc_mir/const_eval/error.rs
index aa30f43df93..d2c35a9d1f7 100644
--- a/src/librustc_mir/const_eval/error.rs
+++ b/src/librustc_mir/const_eval/error.rs
@@ -18,7 +18,7 @@ pub enum ConstEvalErrKind {
 }
 
 // The errors become `MachineStop` with plain strings when being raised.
-// `ConstEvalErr` (in `librustc/mir/interpret/error.rs`) knows to
+// `ConstEvalErr` (in `librustc_middle/mir/interpret/error.rs`) knows to
 // handle these.
 impl<'tcx> Into<InterpErrorInfo<'tcx>> for ConstEvalErrKind {
     fn into(self) -> InterpErrorInfo<'tcx> {
diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs
index 46f8e98ef34..6297a87b346 100644
--- a/src/librustc_mir/interpret/intrinsics.rs
+++ b/src/librustc_mir/interpret/intrinsics.rs
@@ -98,7 +98,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         };
 
         // Keep the patterns in this match ordered the same as the list in
-        // `src/librustc/ty/constness.rs`
+        // `src/librustc_middle/ty/constness.rs`
         match intrinsic_name {
             sym::caller_location => {
                 let span = self.find_closest_untracked_caller_location().unwrap_or(span);
diff --git a/src/librustc_mir_build/Cargo.toml b/src/librustc_mir_build/Cargo.toml
index 96716dbd604..143a3852d73 100644
--- a/src/librustc_mir_build/Cargo.toml
+++ b/src/librustc_mir_build/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
 [dependencies]
 arena = { path = "../libarena" }
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_apfloat = { path = "../librustc_apfloat" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_data_structures = { path = "../librustc_data_structures" }
diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml
index 8acb88f58d3..0ffc8170b50 100644
--- a/src/librustc_passes/Cargo.toml
+++ b/src/librustc_passes/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
 
 [dependencies]
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_errors = { path = "../librustc_errors" }
diff --git a/src/librustc_passes/stability.rs b/src/librustc_passes/stability.rs
index 8fa5a4fbc61..80484a89d4a 100644
--- a/src/librustc_passes/stability.rs
+++ b/src/librustc_passes/stability.rs
@@ -438,7 +438,7 @@ fn new_index(tcx: TyCtxt<'tcx>) -> Index<'tcx> {
         // If the `-Z force-unstable-if-unmarked` flag is passed then we provide
         // a parent stability annotation which indicates that this is private
         // with the `rustc_private` feature. This is intended for use when
-        // compiling librustc crates themselves so we can leverage crates.io
+        // compiling librustc_middle crates themselves so we can leverage crates.io
         // while maintaining the invariant that all sysroot crates are unstable
         // by default and are unable to be used.
         if tcx.sess.opts.debugging_opts.force_unstable_if_unmarked {
diff --git a/src/librustc_plugin_impl/Cargo.toml b/src/librustc_plugin_impl/Cargo.toml
index 372d6a534c8..38cfbd48de2 100644
--- a/src/librustc_plugin_impl/Cargo.toml
+++ b/src/librustc_plugin_impl/Cargo.toml
@@ -11,7 +11,7 @@ path = "lib.rs"
 doctest = false
 
 [dependencies]
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_lint = { path = "../librustc_lint" }
diff --git a/src/librustc_privacy/Cargo.toml b/src/librustc_privacy/Cargo.toml
index 9854e0f6c53..34146113f0e 100644
--- a/src/librustc_privacy/Cargo.toml
+++ b/src/librustc_privacy/Cargo.toml
@@ -9,7 +9,7 @@ name = "rustc_privacy"
 path = "lib.rs"
 
 [dependencies]
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_errors = { path = "../librustc_errors" }
 rustc_hir = { path = "../librustc_hir" }
diff --git a/src/librustc_query_system/dep_graph/dep_node.rs b/src/librustc_query_system/dep_graph/dep_node.rs
index b1d332da115..99eb3cdc0b0 100644
--- a/src/librustc_query_system/dep_graph/dep_node.rs
+++ b/src/librustc_query_system/dep_graph/dep_node.rs
@@ -26,7 +26,7 @@
 //!   could not be instantiated because the current compilation session
 //!   contained no `DefId` for thing that had been removed.
 //!
-//! `DepNode` definition happens in `librustc` with the `define_dep_nodes!()` macro.
+//! `DepNode` definition happens in `librustc_middle` with the `define_dep_nodes!()` macro.
 //! This macro defines the `DepKind` enum and a corresponding `DepConstructor` enum. The
 //! `DepConstructor` enum links a `DepKind` to the parameters that are needed at runtime in order
 //! to construct a valid `DepNode` fingerprint.
diff --git a/src/librustc_query_system/query/config.rs b/src/librustc_query_system/query/config.rs
index 20dad0bd47e..06e3302b263 100644
--- a/src/librustc_query_system/query/config.rs
+++ b/src/librustc_query_system/query/config.rs
@@ -13,8 +13,8 @@ use std::borrow::Cow;
 use std::fmt::Debug;
 use std::hash::Hash;
 
-// The parameter `CTX` is required in librustc: implementations may need to access the `'tcx`
-// lifetime in `CTX = TyCtxt<'tcx>`.
+// The parameter `CTX` is required in librustc_middle:
+// implementations may need to access the `'tcx` lifetime in `CTX = TyCtxt<'tcx>`.
 pub trait QueryConfig<CTX> {
     const NAME: &'static str;
     const CATEGORY: ProfileCategory;
diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml
index 49f079ad270..420a82d6d2c 100644
--- a/src/librustc_resolve/Cargo.toml
+++ b/src/librustc_resolve/Cargo.toml
@@ -15,7 +15,7 @@ bitflags = "1.2.1"
 log = "0.4"
 rustc_ast = { path = "../librustc_ast" }
 arena = { path = "../libarena" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast_lowering = { path = "../librustc_ast_lowering" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_attr = { path = "../librustc_attr" }
diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml
index 623da1ddcb4..5948c88054d 100644
--- a/src/librustc_save_analysis/Cargo.toml
+++ b/src/librustc_save_analysis/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
 
 [dependencies]
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast = { path = "../librustc_ast" }
 rustc_ast_pretty = { path = "../librustc_ast_pretty" }
 rustc_data_structures = { path = "../librustc_data_structures" }
diff --git a/src/librustc_session/filesearch.rs b/src/librustc_session/filesearch.rs
index 05e6da43ea7..4310c508443 100644
--- a/src/librustc_session/filesearch.rs
+++ b/src/librustc_session/filesearch.rs
@@ -143,7 +143,7 @@ fn find_libdir(sysroot: &Path) -> Cow<'static, str> {
     // FIXME: This is a quick hack to make the rustc binary able to locate
     // Rust libraries in Linux environments where libraries might be installed
     // to lib64/lib32. This would be more foolproof by basing the sysroot off
-    // of the directory where librustc is located, rather than where the rustc
+    // of the directory where librustc_middle is located, rather than where the rustc
     // binary is.
     // If --libdir is set during configuration to the value other than
     // "lib" (i.e., non-default), this value is used (see issue #16552).
diff --git a/src/librustc_session/lint.rs b/src/librustc_session/lint.rs
index 1162cff4e0b..f75a3a32d7a 100644
--- a/src/librustc_session/lint.rs
+++ b/src/librustc_session/lint.rs
@@ -195,7 +195,7 @@ pub enum BuiltinLintDiagnostics {
 }
 
 /// Lints that are buffered up early on in the `Session` before the
-/// `LintLevels` is calculated. These are later passed to `librustc`.
+/// `LintLevels` is calculated. These are later passed to `librustc_middle`.
 #[derive(PartialEq)]
 pub struct BufferedEarlyLint {
     /// The span of code that we are linting on.
diff --git a/src/librustc_span/lib.rs b/src/librustc_span/lib.rs
index a0c4c90722d..3bcc20d36e7 100644
--- a/src/librustc_span/lib.rs
+++ b/src/librustc_span/lib.rs
@@ -1544,7 +1544,7 @@ fn lookup_line(lines: &[BytePos], pos: BytePos) -> isize {
 
 /// Requirements for a `StableHashingContext` to be used in this crate.
 /// This is a hack to allow using the `HashStable_Generic` derive macro
-/// instead of implementing everything in librustc.
+/// instead of implementing everything in librustc_middle.
 pub trait HashStableContext {
     fn hash_spans(&self) -> bool;
     fn hash_def_id(&mut self, _: DefId, hasher: &mut StableHasher);
diff --git a/src/librustc_symbol_mangling/Cargo.toml b/src/librustc_symbol_mangling/Cargo.toml
index 1e4fc8f7e68..5d091499c8c 100644
--- a/src/librustc_symbol_mangling/Cargo.toml
+++ b/src/librustc_symbol_mangling/Cargo.toml
@@ -16,7 +16,7 @@ rustc-demangle = "0.1.16"
 
 rustc_ast = { path = "../librustc_ast" }
 rustc_span = { path = "../librustc_span" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_target = { path = "../librustc_target" }
 rustc_data_structures = { path = "../librustc_data_structures" }
diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs
index 98190867d49..b2965fb8806 100644
--- a/src/librustc_target/lib.rs
+++ b/src/librustc_target/lib.rs
@@ -25,5 +25,5 @@ pub mod spec;
 
 /// Requirements for a `StableHashingContext` to be used in this crate.
 /// This is a hack to allow using the `HashStable_Generic` derive macro
-/// instead of implementing everything in librustc.
+/// instead of implementing everything in librustc_middle.
 pub trait HashStableContext {}
diff --git a/src/librustc_trait_selection/Cargo.toml b/src/librustc_trait_selection/Cargo.toml
index 5b2da41d066..254695e53e0 100644
--- a/src/librustc_trait_selection/Cargo.toml
+++ b/src/librustc_trait_selection/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
 fmt_macros = { path = "../libfmt_macros" }
 log = { version = "0.4", features = ["release_max_level_info", "std"] }
 rustc_attr = { path = "../librustc_attr" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_ast = { path = "../librustc_ast" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_errors = { path = "../librustc_errors" }
diff --git a/src/librustc_traits/Cargo.toml b/src/librustc_traits/Cargo.toml
index 5e33efb1cf9..432004c1049 100644
--- a/src/librustc_traits/Cargo.toml
+++ b/src/librustc_traits/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
 
 [dependencies]
 log = { version = "0.4" }
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_macros = { path = "../librustc_macros" }
diff --git a/src/librustc_ty/Cargo.toml b/src/librustc_ty/Cargo.toml
index cf0b4b82eea..37d1ed38d79 100644
--- a/src/librustc_ty/Cargo.toml
+++ b/src/librustc_ty/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
 
 [dependencies]
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_infer = { path = "../librustc_infer" }
diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml
index e61a36f844f..8aaa29bc582 100644
--- a/src/librustc_typeck/Cargo.toml
+++ b/src/librustc_typeck/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
 [dependencies]
 arena = { path = "../libarena" }
 log = "0.4"
-rustc = { path = "../librustc" }
+rustc_middle = { path = "../librustc_middle" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_errors = { path = "../librustc_errors" }
diff --git a/src/librustc_typeck/check/generator_interior.rs b/src/librustc_typeck/check/generator_interior.rs
index cdf68256a7a..0bb9f310ed8 100644
--- a/src/librustc_typeck/check/generator_interior.rs
+++ b/src/librustc_typeck/check/generator_interior.rs
@@ -205,7 +205,7 @@ pub fn resolve_interior<'a, 'tcx>(
 }
 
 // This visitor has to have the same visit_expr calls as RegionResolutionVisitor in
-// librustc/middle/region.rs since `expr_count` is compared against the results
+// librustc_middle/middle/region.rs since `expr_count` is compared against the results
 // there.
 impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
     type Map = intravisit::ErasedMap<'tcx>;
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index fe3a9b6b3dc..7209f0ae2d5 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -103,7 +103,7 @@ impl<'tcx> DocContext<'tcx> {
     }
 
     // This is an ugly hack, but it's the simplest way to handle synthetic impls without greatly
-    // refactoring either librustdoc or librustc. In particular, allowing new DefIds to be
+    // refactoring either librustdoc or librustc_middle. In particular, allowing new DefIds to be
     // registered after the AST is constructed would require storing the defid mapping in a
     // RefCell, decreasing the performance for normal compilation for very little gain.
     //
diff --git a/src/libstd/alloc.rs b/src/libstd/alloc.rs
index 25f3ddcbeba..79dd89e53bb 100644
--- a/src/libstd/alloc.rs
+++ b/src/libstd/alloc.rs
@@ -253,7 +253,7 @@ pub mod __default_lib_allocator {
     // `__rust_alloc` etc symbols (see `src/liballoc/alloc.rs) when there is
     // no `#[global_allocator]` attribute.
 
-    // for symbol names src/librustc/middle/allocator.rs
+    // for symbol names src/librustc_middle/middle/allocator.rs
     // for signatures src/librustc_allocator/lib.rs
 
     // linkage directives are provided as part of the current compiler allocator