Use is_lang_item more aggressively
This commit is contained in:
parent
d5c48ebc71
commit
93ff86ed7c
44 changed files with 171 additions and 166 deletions
|
@ -593,7 +593,7 @@ fn check_recursion_limit<'tcx>(
|
|||
let recursion_depth = recursion_depths.get(&def_id).cloned().unwrap_or(0);
|
||||
debug!(" => recursion depth={}", recursion_depth);
|
||||
|
||||
let adjusted_recursion_depth = if Some(def_id) == tcx.lang_items().drop_in_place_fn() {
|
||||
let adjusted_recursion_depth = if tcx.is_lang_item(def_id, LangItem::DropInPlace) {
|
||||
// HACK: drop_in_place creates tight monomorphization loops. Give
|
||||
// it more margin.
|
||||
recursion_depth / 4
|
||||
|
|
|
@ -104,6 +104,7 @@ use rustc_data_structures::unord::{UnordMap, UnordSet};
|
|||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{DefId, DefIdSet, LOCAL_CRATE};
|
||||
use rustc_hir::definitions::DefPathDataName;
|
||||
use rustc_hir::LangItem;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel};
|
||||
|
@ -813,7 +814,7 @@ fn mono_item_visibility<'tcx>(
|
|||
// from the `main` symbol we'll generate later.
|
||||
//
|
||||
// This may be fixable with a new `InstanceDef` perhaps? Unsure!
|
||||
if tcx.lang_items().start_fn() == Some(def_id) {
|
||||
if tcx.is_lang_item(def_id, LangItem::Start) {
|
||||
*can_be_internalized = false;
|
||||
return Visibility::Hidden;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue