Update comments
This commit is contained in:
parent
7e6be13647
commit
943f6a8ca9
2 changed files with 8 additions and 9 deletions
|
@ -229,7 +229,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
|
||||||
// static libraries.
|
// static libraries.
|
||||||
//
|
//
|
||||||
// If the crate hasn't been included yet and it's not actually required
|
// If the crate hasn't been included yet and it's not actually required
|
||||||
// (e.g., it's an allocator) then we skip it here as well.
|
// (e.g., it's a panic runtime) then we skip it here as well.
|
||||||
for &cnum in tcx.crates(()).iter() {
|
for &cnum in tcx.crates(()).iter() {
|
||||||
let src = tcx.used_crate_source(cnum);
|
let src = tcx.used_crate_source(cnum);
|
||||||
if src.dylib.is_none()
|
if src.dylib.is_none()
|
||||||
|
@ -247,8 +247,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList {
|
||||||
// artifact which means that we may need to inject dependencies of some
|
// artifact which means that we may need to inject dependencies of some
|
||||||
// form.
|
// form.
|
||||||
//
|
//
|
||||||
// Things like allocators and panic runtimes may not have been activated
|
// Things like panic runtimes may not have been activated quite yet, so do so here.
|
||||||
// quite yet, so do so here.
|
|
||||||
activate_injected_dep(CStore::from_tcx(tcx).injected_panic_runtime(), &mut ret, &|cnum| {
|
activate_injected_dep(CStore::from_tcx(tcx).injected_panic_runtime(), &mut ret, &|cnum| {
|
||||||
tcx.is_panic_runtime(cnum)
|
tcx.is_panic_runtime(cnum)
|
||||||
});
|
});
|
||||||
|
@ -355,9 +354,9 @@ fn attempt_static(tcx: TyCtxt<'_>, unavailable: &mut Vec<CrateNum>) -> Option<De
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our allocator/panic runtime may not have been linked above if it wasn't
|
// Our panic runtime may not have been linked above if it wasn't explicitly
|
||||||
// explicitly linked, which is the case for any injected dependency. Handle
|
// linked, which is the case for any injected dependency. Handle that here
|
||||||
// that here and activate them.
|
// and activate it.
|
||||||
activate_injected_dep(CStore::from_tcx(tcx).injected_panic_runtime(), &mut ret, &|cnum| {
|
activate_injected_dep(CStore::from_tcx(tcx).injected_panic_runtime(), &mut ret, &|cnum| {
|
||||||
tcx.is_panic_runtime(cnum)
|
tcx.is_panic_runtime(cnum)
|
||||||
});
|
});
|
||||||
|
@ -393,8 +392,8 @@ fn activate_injected_dep(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// After the linkage for a crate has been determined we need to verify that
|
/// After the linkage for a crate has been determined we need to verify that
|
||||||
// there's only going to be one allocator in the output.
|
/// there's only going to be one panic runtime in the output.
|
||||||
fn verify_ok(tcx: TyCtxt<'_>, list: &DependencyList) {
|
fn verify_ok(tcx: TyCtxt<'_>, list: &DependencyList) {
|
||||||
let sess = &tcx.sess;
|
let sess = &tcx.sess;
|
||||||
if list.is_empty() {
|
if list.is_empty() {
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub enum CrateDepKind {
|
||||||
/// A dependency that is only used for its macros.
|
/// A dependency that is only used for its macros.
|
||||||
MacrosOnly,
|
MacrosOnly,
|
||||||
/// A dependency that is always injected into the dependency list and so
|
/// A dependency that is always injected into the dependency list and so
|
||||||
/// doesn't need to be linked to an rlib, e.g., the injected allocator.
|
/// doesn't need to be linked to an rlib, e.g., the injected panic runtime.
|
||||||
Implicit,
|
Implicit,
|
||||||
/// A dependency that is required by an rlib version of this crate.
|
/// A dependency that is required by an rlib version of this crate.
|
||||||
/// Ordinary `extern crate`s result in `Explicit` dependencies.
|
/// Ordinary `extern crate`s result in `Explicit` dependencies.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue