@@ -495,46 +495,41 @@ pub enum NllRegionVariableOrigin {
495
495
} ,
496
496
}
497
497
498
- // FIXME(eddyb) investigate overlap between this and `TyOrConstInferVar`.
499
498
#[ derive( Copy , Clone , Debug ) ]
500
- pub enum FixupError {
501
- UnresolvedIntTy ( IntVid ) ,
502
- UnresolvedFloatTy ( FloatVid ) ,
503
- UnresolvedTy ( TyVid ) ,
504
- UnresolvedConst ( ConstVid ) ,
505
- UnresolvedEffect ( EffectVid ) ,
506
- }
507
-
508
- /// See the `region_obligations` field for more information.
509
- #[ derive( Clone , Debug ) ]
510
- pub struct RegionObligation < ' tcx > {
511
- pub sub_region : ty:: Region < ' tcx > ,
512
- pub sup_type : Ty < ' tcx > ,
513
- pub origin : SubregionOrigin < ' tcx > ,
499
+ pub struct FixupError {
500
+ unresolved : TyOrConstInferVar ,
514
501
}
515
502
516
503
impl fmt:: Display for FixupError {
517
504
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
518
- use self :: FixupError :: * ;
505
+ use TyOrConstInferVar :: * ;
519
506
520
- match * self {
521
- UnresolvedIntTy ( _) => write ! (
507
+ match self . unresolved {
508
+ TyInt ( _) => write ! (
522
509
f,
523
510
"cannot determine the type of this integer; \
524
511
add a suffix to specify the type explicitly"
525
512
) ,
526
- UnresolvedFloatTy ( _) => write ! (
513
+ TyFloat ( _) => write ! (
527
514
f,
528
515
"cannot determine the type of this number; \
529
516
add a suffix to specify the type explicitly"
530
517
) ,
531
- UnresolvedTy ( _) => write ! ( f, "unconstrained type" ) ,
532
- UnresolvedConst ( _) => write ! ( f, "unconstrained const value" ) ,
533
- UnresolvedEffect ( _) => write ! ( f, "unconstrained effect value" ) ,
518
+ Ty ( _) => write ! ( f, "unconstrained type" ) ,
519
+ Const ( _) => write ! ( f, "unconstrained const value" ) ,
520
+ Effect ( _) => write ! ( f, "unconstrained effect value" ) ,
534
521
}
535
522
}
536
523
}
537
524
525
+ /// See the `region_obligations` field for more information.
526
+ #[ derive( Clone , Debug ) ]
527
+ pub struct RegionObligation < ' tcx > {
528
+ pub sub_region : ty:: Region < ' tcx > ,
529
+ pub sup_type : Ty < ' tcx > ,
530
+ pub origin : SubregionOrigin < ' tcx > ,
531
+ }
532
+
538
533
/// Used to configure inference contexts before their creation.
539
534
pub struct InferCtxtBuilder < ' tcx > {
540
535
tcx : TyCtxt < ' tcx > ,
0 commit comments