Skip to content

Commit 41bfc97

Browse files
committed
Remove unnecessary feature flagging.
1 parent 77784de commit 41bfc97

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

src/librustc/ty/instance.rs

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
use crate::hir::CodegenFnAttrFlags;
2+
use crate::hir::Mutability;
23
use crate::hir::Unsafety;
34
use crate::hir::def::Namespace;
45
use crate::hir::def_id::DefId;
56
use crate::ty::{self, Ty, PolyFnSig, TypeFoldable, SubstsRef, TyCtxt};
67
use crate::ty::print::{FmtPrinter, Printer};
78
use crate::traits;
89
use crate::middle::lang_items::DropInPlaceFnLangItem;
10+
use rustc::middle::lang_items::PanicLocationLangItem;
911
use rustc_target::spec::abi::Abi;
1012
use rustc_macros::HashStable;
1113

@@ -134,24 +136,15 @@ impl<'tcx> Instance<'tcx> {
134136
}
135137

136138
/// Returns `&'static core::panic::Location`, for args of functions with #[track_caller].
137-
pub fn track_caller_ty(_tcx: TyCtxt<'_>) -> Ty<'_> {
138-
#[cfg(bootstrap)]
139-
{ bug!("#[track_caller] isn't supported during bootstrap (yet)."); }
140-
141-
#[cfg(not(bootstrap))]
142-
{
143-
use crate::hir::Mutability;
144-
use rustc::middle::lang_items::PanicLocationLangItem;
145-
146-
let panic_loc_item = _tcx.require_lang_item(PanicLocationLangItem, None);
147-
_tcx.mk_ref(
148-
_tcx.mk_region(ty::RegionKind::ReStatic),
149-
ty::TypeAndMut {
150-
mutbl: Mutability::MutImmutable,
151-
ty: _tcx.type_of(panic_loc_item),
152-
},
153-
)
154-
}
139+
pub fn track_caller_ty(tcx: TyCtxt<'_>) -> Ty<'_> {
140+
let panic_loc_item = tcx.require_lang_item(PanicLocationLangItem, None);
141+
tcx.mk_ref(
142+
tcx.mk_region(ty::RegionKind::ReStatic),
143+
ty::TypeAndMut {
144+
mutbl: Mutability::MutImmutable,
145+
ty: tcx.type_of(panic_loc_item),
146+
},
147+
)
155148
}
156149
}
157150

0 commit comments

Comments
 (0)