Skip to content

Commit 94e4efe

Browse files
committed
For now, ICE on static ConstArgKind::Paths
This will be put behind a feature gate, so no breakage.
1 parent fbb71a9 commit 94e4efe

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+4
-4
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2109,10 +2109,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
21092109
);
21102110
self.lower_const_param(def_id, hir_id)
21112111
}
2112-
Res::Def(
2113-
DefKind::Const | DefKind::Static { .. } | DefKind::Ctor(_, CtorKind::Const),
2114-
did,
2115-
) => {
2112+
Res::Def(DefKind::Const | DefKind::Ctor(_, CtorKind::Const), did) => {
21162113
assert_eq!(opt_self_ty, None);
21172114
let _ = self.prohibit_generic_args(
21182115
path.segments.split_last().unwrap().1.iter(),
@@ -2125,6 +2122,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
21252122
);
21262123
ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst::new(did, args))
21272124
}
2125+
Res::Def(DefKind::Static { .. }, _) => {
2126+
span_bug!(span, "use of bare `static` ConstArgKind::Path's not yet supported")
2127+
}
21282128
// FIXME(const_generics): create real const to allow fn items as const paths
21292129
Res::Def(DefKind::Fn | DefKind::AssocFn, _) => ty::Const::new_error_with_message(
21302130
tcx,

0 commit comments

Comments
 (0)