@@ -495,46 +495,41 @@ pub enum NllRegionVariableOrigin {
495495 } ,
496496}
497497
498- // FIXME(eddyb) investigate overlap between this and `TyOrConstInferVar`.
499498#[ 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 ,
514501}
515502
516503impl fmt:: Display for FixupError {
517504 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
518- use self :: FixupError :: * ;
505+ use TyOrConstInferVar :: * ;
519506
520- match * self {
521- UnresolvedIntTy ( _) => write ! (
507+ match self . unresolved {
508+ TyInt ( _) => write ! (
522509 f,
523510 "cannot determine the type of this integer; \
524511 add a suffix to specify the type explicitly"
525512 ) ,
526- UnresolvedFloatTy ( _) => write ! (
513+ TyFloat ( _) => write ! (
527514 f,
528515 "cannot determine the type of this number; \
529516 add a suffix to specify the type explicitly"
530517 ) ,
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" ) ,
534521 }
535522 }
536523}
537524
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+
538533/// Used to configure inference contexts before their creation.
539534pub struct InferCtxtBuilder < ' tcx > {
540535 tcx : TyCtxt < ' tcx > ,
0 commit comments