1
Fork 0

Rollup merge of #134514 - bjorn3:more_driver_refactors, r=jieyouxu

Improve dependency_format a bit

* Make `DependencyList` an `IndexVec` rather than emulating one using a `Vec` (which was off-by-one as LOCAL_CRATE was intentionally skipped)
* Update some comments for the fact that we now use `#[global_allocator]` rather than `extern crate alloc_system;`/`extern crate alloc_jemalloc;` for specifying which allocator to use. We still use a similar mechanism for the panic runtime, so refer to the panic runtime in those comments instead.
* An unrelated refactor to `create_and_enter_global_ctxt` I forgot to include in https://github.com/rust-lang/rust/pull/134302. This refactor is too small to be worth it's own PR.
This commit is contained in:
DianQK 2024-12-20 21:47:00 +08:00 committed by GitHub
commit 350e7f858e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 100 additions and 86 deletions

View file

@ -8,13 +8,13 @@
// this will introduce circular dependency between rustc_metadata and rustc_middle
use rustc_data_structures::fx::FxIndexMap;
use rustc_hir::def_id::CrateNum;
use rustc_index::IndexVec;
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_session::config::CrateType;
/// A list of dependencies for a certain crate type.
///
/// The length of this vector is the same as the number of external crates used.
pub type DependencyList = Vec<Linkage>;
pub type DependencyList = IndexVec<CrateNum, Linkage>;
/// A mapping of all required dependencies for a particular flavor of output.
///