Skip to content

Commit 6596165

Browse files
Use type-based qualification for statics
1 parent b0b7dc3 commit 6596165

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_mir/transform/check_consts/qualifs.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ pub trait Qualif {
3333
/// of the type.
3434
fn in_any_value_of_ty(_cx: &ConstCx<'_, 'tcx>, _ty: Ty<'tcx>) -> bool;
3535

36-
fn in_static(_cx: &ConstCx<'_, 'tcx>, _def_id: DefId) -> bool {
37-
// FIXME(eddyb) should we do anything here for value properties?
38-
false
36+
fn in_static(cx: &ConstCx<'_, 'tcx>, def_id: DefId) -> bool {
37+
// `mir_const_qualif` does return the qualifs in the final value of a `static`, so we could
38+
// use value-based qualification here, but we shouldn't do this without a good reason.
39+
Self::in_any_value_of_ty(cx, cx.tcx.type_of(def_id))
3940
}
4041

4142
fn in_projection_structurally(

0 commit comments

Comments
 (0)