Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3817,6 +3817,7 @@ dependencies = [
"rustc_abi",
"rustc_ast",
"rustc_codegen_ssa",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_fs_util",
Expand Down Expand Up @@ -3853,6 +3854,7 @@ dependencies = [
"rustc_arena",
"rustc_ast",
"rustc_attr_parsing",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_fs_util",
Expand Down Expand Up @@ -3903,6 +3905,19 @@ dependencies = [
"tracing",
]

[[package]]
name = "rustc_crate_store"
version = "0.0.0"
dependencies = [
"rustc_abi",
"rustc_attr_ir",
"rustc_data_structures",
"rustc_hir_id",
"rustc_macros",
"rustc_serialize",
"rustc_span",
]

[[package]]
name = "rustc_data_structures"
version = "0.0.0"
Expand Down Expand Up @@ -4091,15 +4106,13 @@ name = "rustc_hir"
version = "0.0.0"
dependencies = [
"bitflags",
"odht",
"rustc_abi",
"rustc_arena",
"rustc_ast",
"rustc_attr_ir",
"rustc_data_structures",
"rustc_error_messages",
"rustc_errors",
"rustc_hashes",
"rustc_hir_id",
"rustc_index",
"rustc_lint_defs",
Expand Down Expand Up @@ -4139,11 +4152,14 @@ dependencies = [
name = "rustc_hir_id"
version = "0.0.0"
dependencies = [
"odht",
"rustc_data_structures",
"rustc_hashes",
"rustc_index",
"rustc_macros",
"rustc_serialize",
"rustc_span",
"tracing",
]

[[package]]
Expand Down Expand Up @@ -4253,6 +4269,7 @@ dependencies = [
"rustc_codegen_llvm",
"rustc_codegen_ssa",
"rustc_const_eval",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
Expand Down Expand Up @@ -4381,6 +4398,7 @@ dependencies = [
"rustc_abi",
"rustc_ast",
"rustc_attr_parsing",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
Expand Down Expand Up @@ -4414,6 +4432,7 @@ dependencies = [
"rustc_arena",
"rustc_ast",
"rustc_ast_ir",
"rustc_crate_store",
"rustc_data_structures",
"rustc_error_messages",
"rustc_errors",
Expand Down Expand Up @@ -4577,6 +4596,7 @@ dependencies = [
"rustc_ast",
"rustc_ast_lowering",
"rustc_attr_parsing",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_expand",
Expand Down Expand Up @@ -4642,10 +4662,10 @@ name = "rustc_public"
version = "0.1.0-preview"
dependencies = [
"rustc_abi",
"rustc_crate_store",
"rustc_hir",
"rustc_middle",
"rustc_public_bridge",
"rustc_session",
"rustc_span",
"rustc_target",
"scoped-tls",
Expand All @@ -4659,11 +4679,11 @@ name = "rustc_public_bridge"
version = "0.0.0"
dependencies = [
"rustc_abi",
"rustc_crate_store",
"rustc_data_structures",
"rustc_hir",
"rustc_hir_pretty",
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
]
Expand Down Expand Up @@ -4753,7 +4773,6 @@ dependencies = [
"rustc_feature",
"rustc_fs_util",
"rustc_hashes",
"rustc_hir",
"rustc_lint_defs",
"rustc_macros",
"rustc_serialize",
Expand Down Expand Up @@ -4855,6 +4874,7 @@ dependencies = [
"itertools",
"rustc_abi",
"rustc_ast",
"rustc_crate_store",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rustc-demangle = "0.1.28"
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
rustc_crate_store = { path = "../rustc_crate_store" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fs_util = { path = "../rustc_fs_util" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ use rustc_abi::{self as abi, ExternAbi, HasDataLayout as _};
use rustc_ast::Mutability;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::traits::*;
use rustc_crate_store::DllImport;
use rustc_data_structures::stable_hash::{StableHash, StableHasher};
use rustc_hashes::Hash128;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::DefId;
use rustc_middle::bug;
use rustc_middle::mir::interpret::{GlobalAlloc, PointerArithmetic, Scalar};
use rustc_middle::ty::{Instance, TyCtxt};
use rustc_session::cstore::DllImport;
use rustc_session::{PointerAuthAddressDiscriminator, PointerAuthSchema};
use tracing::debug;

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
rustc_crate_store = { path = "../rustc_crate_store" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_fs_util = { path = "../rustc_fs_util" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use std::io::{BufWriter, Write};
use std::path::{Path, PathBuf};

use rustc_abi::Endian;
use rustc_crate_store::{DllImport, DllImportSymbolType};
use rustc_data_structures::base_n::{CASE_INSENSITIVE, ToBaseN};
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
use rustc_data_structures::stable_hash::StableHasher;
use rustc_hashes::Hash128;
use rustc_hir::attrs::NativeLibKind;
use rustc_session::Session;
use rustc_session::cstore::{DllImport, DllImportSymbolType};
use rustc_span::Symbol;
use rustc_target::spec::Arch;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::hash_map::Entry::*;

use rustc_abi::{CanonAbi, X86Call};
use rustc_ast::expand::allocator::{AllocatorKind, NO_ALLOC_SHIM_IS_UNSTABLE, global_fn_name};
use rustc_crate_store::CrateDepKind;
use rustc_data_structures::unord::UnordMap;
use rustc_hir as hir;
use rustc_hir::def::DefKind;
Expand All @@ -17,7 +18,6 @@ use rustc_middle::ty::{
};
use rustc_middle::util::Providers;
use rustc_session::config::CrateType;
use rustc_session::cstore::CrateDepKind;
use rustc_span::Span;
use rustc_symbol_mangling::mangle_internal_symbol;
use rustc_target::spec::{Arch, Os, TlsModel};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#![allow(non_camel_case_types)]

use rustc_crate_store::{DllCallingConvention, DllImport, DllImportSymbolType};
use rustc_hir::attrs::PeImportNameType;
use rustc_hir::attrs::lang_items::LangItem;
use rustc_middle::mir::interpret::{GlobalAlloc, PointerArithmetic, Scalar};
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::{self, Instance, ScalarInt, TyCtxt};
use rustc_middle::{bug, span_bug};
use rustc_session::cstore::{DllCallingConvention, DllImport, DllImportSymbolType};
use rustc_span::Span;
use rustc_target::spec::{CfgAbi, Env, Os, Target};

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::path::{Path, PathBuf};
use std::sync::Arc;

use rustc_abi::Size;
use rustc_crate_store::{self as cstore, CrateSource};
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_hir::CRATE_HIR_ID;
Expand All @@ -38,7 +39,6 @@ use rustc_serialize::opaque::{FileEncoder, MemDecoder};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use rustc_session::Session;
use rustc_session::config::{CrateType, OutputFilenames, OutputType};
use rustc_session::cstore::{self, CrateSource};
use rustc_session::lint::builtin::LINKER_MESSAGES;
use rustc_span::{Span, Symbol};

Expand Down Expand Up @@ -207,7 +207,7 @@ bitflags::bitflags! {
}
}

// This is the same as `rustc_session::cstore::NativeLib`, except:
// This is the same as `rustc_crate_store::NativeLib`, except:
// - (important) the `foreign_module` field is missing, because it contains a `DefId`, which can't
// be encoded with `FileEncoder`.
// - (less important) the `verbatim` field is a `bool` rather than an `Option<bool>`, because here
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_crate_store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "rustc_crate_store"
version = "0.0.0"
edition = "2024"

[dependencies]
# tidy-alphabetical-start
rustc_abi = { path = "../rustc_abi" }
rustc_attr_ir = { path = "../rustc_attr_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir_id = { path = "../rustc_hir_id" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
# tidy-alphabetical-end
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ use std::path::PathBuf;
use rustc_abi::ExternAbi;
use rustc_attr_ir::{CfgEntry, NativeLibKind, PeImportNameType};
use rustc_data_structures::sync::{self, AppendOnlyIndexVec, FreezeLock};
// FIXME: Can we not depend on `rustc_hir` here? :)
use rustc_hir::definitions::{DefKey, DefPath, Definitions};
use rustc_hir_id::definitions::{DefKey, DefPath, Definitions};
use rustc_macros::{BlobDecodable, Decodable, Encodable, StableHash};
use rustc_span::def_id::{
CrateNum, DefId, DefPathHash, LOCAL_CRATE, LocalDefId, StableCrateId, StableCrateIdMap,
};
use rustc_span::{Span, Symbol};

// lonely orphan structs and enums looking for a better home

/// Where a crate came from on the local filesystem. One of these three options
/// must be non-None.
#[derive(PartialEq, Clone, Debug, StableHash, Encodable, Decodable)]
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_crate_store/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod cstore;

pub use cstore::*;
2 changes: 0 additions & 2 deletions compiler/rustc_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.9.1"
odht = { version = "0.3.1", features = ["nightly"] }
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_ir = { path = "../rustc_attr_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_error_messages = { path = "../rustc_error_messages" }
rustc_errors = { path = "../rustc_errors" }
rustc_hashes = { path = "../rustc_hashes" }
rustc_hir_id = { path = "../rustc_hir_id" }
rustc_index = { path = "../rustc_index" }
rustc_lint_defs = { path = "../rustc_lint_defs" }
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@

mod arena;
pub mod def;
pub mod def_path_hash_map;
pub mod definitions;
mod hir;
pub mod intravisit;
pub mod lints;
pub mod pat_util;
mod stable_hash_impls;
mod target_impls;

#[cfg(test)]
mod tests;

#[doc(no_inline)]
pub use hir::*;
pub use rustc_attr_ir::{self as attrs, find_attr};
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_hir_id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
odht = { version = "0.3.1", features = ["nightly"] }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hashes = { path = "../rustc_hashes" }
rustc_index = { path = "../rustc_index" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
tracing = "0.1"
# tidy-alphabetical-end
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ use rustc_data_structures::stable_hash::StableHasher;
use rustc_hashes::Hash64;
use rustc_index::IndexVec;
use rustc_macros::{BlobDecodable, Decodable, Encodable, extension};
use rustc_span::def_id::LocalDefIdMap;
pub use rustc_span::def_id::DefPathHash;
use rustc_span::def_id::{
CRATE_DEF_INDEX, CrateNum, DefIndex, LOCAL_CRATE, LocalDefId, LocalDefIdMap, StableCrateId,
};
use rustc_span::{Symbol, kw, sym};
use tracing::{debug, instrument};

pub use crate::def_id::DefPathHash;
use crate::def_id::{CRATE_DEF_INDEX, CrateNum, DefIndex, LOCAL_CRATE, LocalDefId, StableCrateId};
use crate::def_path_hash_map::DefPathHashMap;

#[derive(Debug, Default, Clone)]
Expand Down
6 changes: 6 additions & 0 deletions compiler/rustc_hir_id/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#![feature(negative_impls)]
#![feature(rustc_attrs)]

pub mod def_path_hash_map;
pub mod definitions;

#[cfg(test)]
mod tests;

use std::fmt::{self, Debug};

use rustc_data_structures::stable_hash::{
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions compiler/rustc_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rustc_builtin_macros = { path = "../rustc_builtin_macros" }
rustc_codegen_llvm = { path = "../rustc_codegen_llvm", optional = true }
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
rustc_const_eval = { path = "../rustc_const_eval" }
rustc_crate_store = { path = "../rustc_crate_store" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_expand = { path = "../rustc_expand" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use rustc_ast as ast;
use rustc_attr_parsing::{AttributeParser, ShouldEmit};
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_codegen_ssa::{CompiledModules, CrateInfo};
use rustc_crate_store::Untracked;
use rustc_data_structures::indexmap::IndexMap;
use rustc_data_structures::steal::Steal;
use rustc_data_structures::sync::{
Expand Down Expand Up @@ -36,7 +37,6 @@ use rustc_parse::{new_parser_from_file, new_parser_from_source_str, unwrap_or_em
use rustc_passes::{abi_test, input_stats, layout_test};
use rustc_resolve::{Resolver, ResolverOutputs};
use rustc_session::config::{CrateType, Input, OutFileName, OutputFilenames, OutputType};
use rustc_session::cstore::Untracked;
use rustc_session::diagnostics::feature_err;
use rustc_session::output::{filename_for_input, invalid_output_for_target};
use rustc_session::search_paths::PathKind;
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ odht = { version = "0.3.1", features = ["nightly"] }
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
rustc_crate_store = { path = "../rustc_crate_store" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_expand = { path = "../rustc_expand" }
Expand Down
Loading
Loading