@@ -14,7 +14,7 @@ pub fn is_min_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'a Body<'tcx>) -
14
14
// Prevent const trait methods from being annotated as `stable`.
15
15
if tcx. features ( ) . staged_api {
16
16
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
17
- if crate :: const_eval:: is_parent_const_impl_raw ( tcx, hir_id) {
17
+ if rustc_mir :: const_eval:: is_parent_const_impl_raw ( tcx, hir_id) {
18
18
return Err ( ( body. span , "trait methods cannot be stable const fn" . into ( ) ) ) ;
19
19
}
20
20
}
@@ -32,13 +32,13 @@ pub fn is_min_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'a Body<'tcx>) -
32
32
| ty:: PredicateAtom :: ConstEquate ( ..)
33
33
| ty:: PredicateAtom :: TypeWellFormedFromEnv ( ..) => continue ,
34
34
ty:: PredicateAtom :: ObjectSafe ( _) => {
35
- bug ! ( "object safe predicate on function: {:#?}" , predicate)
35
+ panic ! ( "object safe predicate on function: {:#?}" , predicate)
36
36
}
37
37
ty:: PredicateAtom :: ClosureKind ( ..) => {
38
- bug ! ( "closure kind predicate on function: {:#?}" , predicate)
38
+ panic ! ( "closure kind predicate on function: {:#?}" , predicate)
39
39
}
40
40
ty:: PredicateAtom :: Subtype ( _) => {
41
- bug ! ( "subtype predicate on function: {:#?}" , predicate)
41
+ panic ! ( "subtype predicate on function: {:#?}" , predicate)
42
42
}
43
43
ty:: PredicateAtom :: Trait ( pred, constness) => {
44
44
if Some ( pred. def_id ( ) ) == tcx. lang_items ( ) . sized_trait ( ) {
@@ -343,7 +343,7 @@ fn feature_allowed(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: Symbol) -> bo
343
343
344
344
// However, we cannot allow stable `const fn`s to use unstable features without an explicit
345
345
// opt-in via `allow_internal_unstable`.
346
- super :: check_consts:: allow_internal_unstable ( tcx, def_id, feature_gate)
346
+ rustc_mir :: transform :: check_consts:: allow_internal_unstable ( tcx, def_id, feature_gate)
347
347
}
348
348
349
349
/// Returns `true` if the given library feature gate is allowed within the function with the given `DefId`.
@@ -362,7 +362,7 @@ pub fn lib_feature_allowed(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: Symbo
362
362
363
363
// However, we cannot allow stable `const fn`s to use unstable features without an explicit
364
364
// opt-in via `allow_internal_unstable`.
365
- super :: check_consts:: allow_internal_unstable ( tcx, def_id, feature_gate)
365
+ rustc_mir :: transform :: check_consts:: allow_internal_unstable ( tcx, def_id, feature_gate)
366
366
}
367
367
368
368
fn check_terminator (
@@ -407,8 +407,8 @@ fn check_terminator(
407
407
if let ty:: FnDef ( fn_def_id, _) = * fn_ty. kind ( ) {
408
408
// Allow unstable const if we opt in by using #[allow_internal_unstable]
409
409
// on function or macro declaration.
410
- if !crate :: const_eval:: is_min_const_fn ( tcx, fn_def_id)
411
- && !crate :: const_eval:: is_unstable_const_fn ( tcx, fn_def_id)
410
+ if !rustc_mir :: const_eval:: is_min_const_fn ( tcx, fn_def_id)
411
+ && !rustc_mir :: const_eval:: is_unstable_const_fn ( tcx, fn_def_id)
412
412
. map ( |feature| {
413
413
span. allows_unstable ( feature)
414
414
|| lib_feature_allowed ( tcx, def_id, feature)
0 commit comments