Function ABI is irrelevant for reachability
This commit is contained in:
parent
35936c4839
commit
955f762fc1
1 changed files with 1 additions and 12 deletions
|
@ -19,7 +19,6 @@ use rustc_middle::query::Providers;
|
||||||
use rustc_middle::ty::{self, ExistentialTraitRef, TyCtxt};
|
use rustc_middle::ty::{self, ExistentialTraitRef, TyCtxt};
|
||||||
use rustc_privacy::DefIdVisitor;
|
use rustc_privacy::DefIdVisitor;
|
||||||
use rustc_session::config::CrateType;
|
use rustc_session::config::CrateType;
|
||||||
use rustc_target::spec::abi::Abi;
|
|
||||||
|
|
||||||
fn item_might_be_inlined(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
fn item_might_be_inlined(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
||||||
tcx.generics_of(def_id).requires_monomorphization(tcx)
|
tcx.generics_of(def_id).requires_monomorphization(tcx)
|
||||||
|
@ -141,16 +140,6 @@ impl<'tcx> ReachableContext<'tcx> {
|
||||||
if !self.any_library {
|
if !self.any_library {
|
||||||
// If we are building an executable, only explicitly extern
|
// If we are building an executable, only explicitly extern
|
||||||
// types need to be exported.
|
// types need to be exported.
|
||||||
let reachable =
|
|
||||||
if let Node::Item(hir::Item { kind: hir::ItemKind::Fn(sig, ..), .. })
|
|
||||||
| Node::ImplItem(hir::ImplItem {
|
|
||||||
kind: hir::ImplItemKind::Fn(sig, ..), ..
|
|
||||||
}) = *node
|
|
||||||
{
|
|
||||||
sig.header.abi != Abi::Rust
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
};
|
|
||||||
let codegen_attrs = if self.tcx.def_kind(search_item).has_codegen_attrs() {
|
let codegen_attrs = if self.tcx.def_kind(search_item).has_codegen_attrs() {
|
||||||
self.tcx.codegen_fn_attrs(search_item)
|
self.tcx.codegen_fn_attrs(search_item)
|
||||||
} else {
|
} else {
|
||||||
|
@ -159,7 +148,7 @@ impl<'tcx> ReachableContext<'tcx> {
|
||||||
let is_extern = codegen_attrs.contains_extern_indicator();
|
let is_extern = codegen_attrs.contains_extern_indicator();
|
||||||
let std_internal =
|
let std_internal =
|
||||||
codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
|
codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
|
||||||
if reachable || is_extern || std_internal {
|
if is_extern || std_internal {
|
||||||
self.reachable_symbols.insert(search_item);
|
self.reachable_symbols.insert(search_item);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue