Skip to content

Commit 356b6c7

Browse files
Rollup merge of rust-lang#124648 - nnethercote:trim-crate-graph, r=jackh726
Trim crate graph This PR removes some unnecessary `Cargo.toml` entries, and makes some other small related cleanups that I found while looking at this stuff. r? ```@pnkfelix```
2 parents 9dfd527 + a503893 commit 356b6c7

File tree

10 files changed

+13
-26
lines changed

10 files changed

+13
-26
lines changed

Cargo.lock

-4
Original file line numberDiff line numberDiff line change
@@ -3824,7 +3824,6 @@ dependencies = [
38243824
"rustc_session",
38253825
"rustc_smir",
38263826
"rustc_span",
3827-
"rustc_symbol_mangling",
38283827
"rustc_target",
38293828
"rustc_trait_selection",
38303829
"rustc_ty_utils",
@@ -4008,7 +4007,6 @@ dependencies = [
40084007
"rustc_data_structures",
40094008
"rustc_errors",
40104009
"rustc_fluent_macro",
4011-
"rustc_graphviz",
40124010
"rustc_hir",
40134011
"rustc_hir_analysis",
40144012
"rustc_hir_pretty",
@@ -4468,7 +4466,6 @@ dependencies = [
44684466
"rustc_errors",
44694467
"rustc_fluent_macro",
44704468
"rustc_hir",
4471-
"rustc_hir_analysis",
44724469
"rustc_macros",
44734470
"rustc_middle",
44744471
"rustc_session",
@@ -4515,7 +4512,6 @@ dependencies = [
45154512
"rustc_session",
45164513
"rustc_span",
45174514
"rustc_target",
4518-
"rustc_type_ir",
45194515
"smallvec",
45204516
"thin-vec",
45214517
"tracing",

compiler/rustc_builtin_macros/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fn make_format_args(
307307
return ExpandResult::Ready(Err(guar));
308308
}
309309

310-
let to_span = |inner_span: rustc_parse_format::InnerSpan| {
310+
let to_span = |inner_span: parse::InnerSpan| {
311311
is_source_literal.then(|| {
312312
fmt_span.from_inner(InnerSpan { start: inner_span.start, end: inner_span.end })
313313
})
@@ -577,7 +577,7 @@ fn make_format_args(
577577
fn invalid_placeholder_type_error(
578578
ecx: &ExtCtxt<'_>,
579579
ty: &str,
580-
ty_span: Option<rustc_parse_format::InnerSpan>,
580+
ty_span: Option<parse::InnerSpan>,
581581
fmt_span: Span,
582582
) {
583583
let sp = ty_span.map(|sp| fmt_span.from_inner(InnerSpan::new(sp.start, sp.end)));

compiler/rustc_driver_impl/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ rustc_privacy = { path = "../rustc_privacy" }
4242
rustc_query_system = { path = "../rustc_query_system" }
4343
rustc_resolve = { path = "../rustc_resolve" }
4444
rustc_session = { path = "../rustc_session" }
45-
rustc_smir ={ path = "../rustc_smir" }
45+
rustc_smir = { path = "../rustc_smir" }
4646
rustc_span = { path = "../rustc_span" }
47-
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
4847
rustc_target = { path = "../rustc_target" }
4948
rustc_trait_selection = { path = "../rustc_trait_selection" }
5049
rustc_ty_utils = { path = "../rustc_ty_utils" }

compiler/rustc_errors/src/diagnostic_impls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol};
1313
use rustc_span::Span;
1414
use rustc_target::abi::TargetDataLayoutErrors;
1515
use rustc_target::spec::{PanicStrategy, SplitDebuginfo, StackProtector, TargetTriple};
16-
use rustc_type_ir as type_ir;
16+
use rustc_type_ir::{ClosureKind, FloatTy};
1717
use std::backtrace::Backtrace;
1818
use std::borrow::Cow;
1919
use std::fmt;
@@ -196,7 +196,7 @@ impl IntoDiagArg for ast::token::TokenKind {
196196
}
197197
}
198198

199-
impl IntoDiagArg for type_ir::FloatTy {
199+
impl IntoDiagArg for FloatTy {
200200
fn into_diag_arg(self) -> DiagArgValue {
201201
DiagArgValue::Str(Cow::Borrowed(self.name_str()))
202202
}
@@ -252,7 +252,7 @@ impl IntoDiagArg for Level {
252252
}
253253
}
254254

255-
impl IntoDiagArg for type_ir::ClosureKind {
255+
impl IntoDiagArg for ClosureKind {
256256
fn into_diag_arg(self) -> DiagArgValue {
257257
DiagArgValue::Str(self.as_str().into())
258258
}

compiler/rustc_hir_typeck/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ rustc_attr = { path = "../rustc_attr" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }
1414
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
15-
rustc_graphviz = { path = "../rustc_graphviz" }
1615
rustc_hir = { path = "../rustc_hir" }
1716
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
1817
rustc_hir_pretty = { path = "../rustc_hir_pretty" }

compiler/rustc_hir_typeck/src/pat.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use rustc_hir::pat_util::EnumerateAndAdjustIterator;
1010
use rustc_hir::{self as hir, BindingMode, ByRef, HirId, Mutability, Pat, PatKind};
1111
use rustc_infer::infer;
1212
use rustc_infer::infer::type_variable::TypeVariableOrigin;
13-
use rustc_lint as lint;
1413
use rustc_middle::mir::interpret::ErrorHandled;
1514
use rustc_middle::ty::{self, Ty, TypeVisitableExt};
1615
use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
@@ -684,7 +683,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
684683
{
685684
// `mut x` resets the binding mode in edition <= 2021.
686685
self.tcx.emit_node_span_lint(
687-
lint::builtin::DEREFERENCING_MUT_BINDING,
686+
rustc_lint::builtin::DEREFERENCING_MUT_BINDING,
688687
pat.hir_id,
689688
pat.span,
690689
errors::DereferencingMutBinding { span: pat.span },

compiler/rustc_interface/src/passes.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::proc_macro_decls;
44
use crate::util;
55

66
use rustc_ast::{self as ast, visit};
7-
use rustc_borrowck as mir_borrowck;
87
use rustc_codegen_ssa::traits::CodegenBackend;
98
use rustc_data_structures::parallel;
109
use rustc_data_structures::steal::Steal;
@@ -20,7 +19,6 @@ use rustc_middle::arena::Arena;
2019
use rustc_middle::dep_graph::DepGraph;
2120
use rustc_middle::ty::{self, GlobalCtxt, RegisteredTools, TyCtxt};
2221
use rustc_middle::util::Providers;
23-
use rustc_mir_build as mir_build;
2422
use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str, validate_attr};
2523
use rustc_passes::{abi_test, hir_stats, layout_test};
2624
use rustc_resolve::Resolver;
@@ -616,8 +614,8 @@ pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
616614
proc_macro_decls::provide(providers);
617615
rustc_const_eval::provide(providers);
618616
rustc_middle::hir::provide(providers);
619-
mir_borrowck::provide(providers);
620-
mir_build::provide(providers);
617+
rustc_borrowck::provide(providers);
618+
rustc_mir_build::provide(providers);
621619
rustc_mir_transform::provide(providers);
622620
rustc_monomorphize::provide(providers);
623621
rustc_privacy::provide(providers);

compiler/rustc_interface/src/util.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@ use rustc_data_structures::sync;
77
use rustc_metadata::{load_symbol_from_dylib, DylibError};
88
use rustc_middle::ty::CurrentGcx;
99
use rustc_parse::validate_attr;
10-
use rustc_session as session;
11-
use rustc_session::config::{Cfg, OutFileName, OutputFilenames, OutputTypes};
10+
use rustc_session::config::{host_triple, Cfg, OutFileName, OutputFilenames, OutputTypes};
1211
use rustc_session::filesearch::sysroot_candidates;
1312
use rustc_session::lint::{self, BuiltinLintDiag, LintBuffer};
14-
use rustc_session::{filesearch, Session};
13+
use rustc_session::output::{categorize_crate_type, CRATE_TYPES};
14+
use rustc_session::{filesearch, EarlyDiagCtxt, Session};
1515
use rustc_span::edit_distance::find_best_match_for_name;
1616
use rustc_span::edition::Edition;
1717
use rustc_span::source_map::SourceMapInputs;
1818
use rustc_span::symbol::sym;
1919
use rustc_target::spec::Target;
20-
use session::output::{categorize_crate_type, CRATE_TYPES};
21-
use session::EarlyDiagCtxt;
2220
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
2321
use std::path::{Path, PathBuf};
2422
use std::sync::atomic::{AtomicBool, Ordering};
@@ -286,7 +284,7 @@ fn get_codegen_sysroot(
286284
"cannot load the default codegen backend twice"
287285
);
288286

289-
let target = session::config::host_triple();
287+
let target = host_triple();
290288
let sysroot_candidates = sysroot_candidates();
291289

292290
let sysroot = iter::once(sysroot)

compiler/rustc_privacy/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ rustc_data_structures = { path = "../rustc_data_structures" }
1111
rustc_errors = { path = "../rustc_errors" }
1212
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1313
rustc_hir = { path = "../rustc_hir" }
14-
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
1514
rustc_macros = { path = "../rustc_macros" }
1615
rustc_middle = { path = "../rustc_middle" }
1716
rustc_session = { path = "../rustc_session" }

compiler/rustc_query_system/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ rustc_serialize = { path = "../rustc_serialize" }
1919
rustc_session = { path = "../rustc_session" }
2020
rustc_span = { path = "../rustc_span" }
2121
rustc_target = { path = "../rustc_target" }
22-
rustc_type_ir = { path = "../rustc_type_ir" }
2322
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
2423
thin-vec = "0.2.12"
2524
tracing = "0.1"

0 commit comments

Comments
 (0)