We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 007fcda commit fc02351Copy full SHA for fc02351
1 file changed
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
@@ -2922,7 +2922,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
2922
.unwrap_or_else(|guar| Const::new_error(tcx, guar))
2923
}
2924
Res::Def(DefKind::Static { .. }, _) => {
2925
- span_bug!(span, "use of bare `static` ConstArgKind::Path's not yet supported")
+ let guar = self
2926
+ .dcx()
2927
+ .span_err(path.span, "static items cannot be used as const arguments");
2928
+ return Const::new_error(tcx, guar);
2929
2930
// FIXME(const_generics): create real const to allow fn items as const paths
2931
Res::Def(DefKind::Fn | DefKind::AssocFn, did) => {
0 commit comments