1
1
use crate :: { build, shim} ;
2
2
use rustc_index:: vec:: IndexVec ;
3
3
use rustc:: hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
4
- use rustc:: mir:: { Body , MirPhase , Promoted } ;
4
+ use rustc:: mir:: { Body , MirPhase , Promoted , QualifSet } ;
5
5
use rustc:: ty:: { TyCtxt , InstanceDef , TypeFoldable } ;
6
6
use rustc:: ty:: query:: Providers ;
7
7
use rustc:: ty:: steal:: Steal ;
@@ -184,12 +184,12 @@ pub fn run_passes(
184
184
body. phase = mir_phase;
185
185
}
186
186
187
- fn mir_const_qualif ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> u8 {
187
+ fn mir_const_qualif ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> QualifSet {
188
188
let const_kind = check_consts:: ConstKind :: for_item ( tcx, def_id) ;
189
189
190
190
// No need to const-check a non-const `fn`.
191
191
if const_kind. is_none ( ) {
192
- return 0 ;
192
+ return Default :: default ( ) ;
193
193
}
194
194
195
195
// N.B., this `borrow()` is guaranteed to be valid (i.e., the value
@@ -200,7 +200,7 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def_id: DefId) -> u8 {
200
200
201
201
if body. return_ty ( ) . references_error ( ) {
202
202
tcx. sess . delay_span_bug ( body. span , "mir_const_qualif: MIR had errors" ) ;
203
- return 0 ;
203
+ return Default :: default ( ) ;
204
204
}
205
205
206
206
let item = check_consts:: Item {
0 commit comments