Rollup merge of #123063 - tmiasko:reachability-abi, r=michaelwoerister
Function ABI is irrelevant for reachability
This commit is contained in:
commit
732ded92a0
1 changed files with 1 additions and 12 deletions
|
@ -24,7 +24,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;
|
|
||||||
|
|
||||||
/// Determines whether this item is recursive for reachability. See `is_recursively_reachable_local`
|
/// Determines whether this item is recursive for reachability. See `is_recursively_reachable_local`
|
||||||
/// below for details.
|
/// below for details.
|
||||||
|
@ -164,16 +163,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 {
|
||||||
|
@ -182,7 +171,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