@@ -28,7 +28,6 @@ pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, Selecti
2828
2929pub type CanonicalChalkEnvironmentAndGoal < ' tcx > = Canonical < ' tcx , ChalkEnvironmentAndGoal < ' tcx > > ;
3030
31- pub use self :: ImplSource :: * ;
3231pub use self :: ObligationCauseCode :: * ;
3332
3433pub use self :: chalk:: { ChalkEnvironmentAndGoal , RustInterner as ChalkRustInterner } ;
@@ -418,10 +417,10 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
418417///
419418/// // Case B: ImplSource must be provided by caller. This applies when
420419/// // type is a type parameter.
421- /// param.clone(); // ImplSourceParam
420+ /// param.clone(); // ImplSource::Param
422421///
423422/// // Case C: A mix of cases A and B.
424- /// mixed.clone(); // ImplSource(Impl_1, [ImplSourceParam ])
423+ /// mixed.clone(); // ImplSource(Impl_1, [ImplSource::Param ])
425424/// }
426425/// ```
427426///
@@ -431,72 +430,72 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
431430#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , TypeFoldable , Lift ) ]
432431pub enum ImplSource < ' tcx , N > {
433432 /// ImplSource identifying a particular impl.
434- ImplSourceUserDefined ( ImplSourceUserDefinedData < ' tcx , N > ) ,
433+ UserDefined ( ImplSourceUserDefinedData < ' tcx , N > ) ,
435434
436435 /// ImplSource for auto trait implementations.
437436 /// This carries the information and nested obligations with regards
438437 /// to an auto implementation for a trait `Trait`. The nested obligations
439438 /// ensure the trait implementation holds for all the constituent types.
440- ImplSourceAutoImpl ( ImplSourceAutoImplData < N > ) ,
439+ AutoImpl ( ImplSourceAutoImplData < N > ) ,
441440
442441 /// Successful resolution to an obligation provided by the caller
443442 /// for some type parameter. The `Vec<N>` represents the
444443 /// obligations incurred from normalizing the where-clause (if
445444 /// any).
446- ImplSourceParam ( Vec < N > ) ,
445+ Param ( Vec < N > ) ,
447446
448447 /// Virtual calls through an object.
449- ImplSourceObject ( ImplSourceObjectData < ' tcx , N > ) ,
448+ Object ( ImplSourceObjectData < ' tcx , N > ) ,
450449
451450 /// Successful resolution for a builtin trait.
452- ImplSourceBuiltin ( ImplSourceBuiltinData < N > ) ,
451+ Builtin ( ImplSourceBuiltinData < N > ) ,
453452
454453 /// ImplSource automatically generated for a closure. The `DefId` is the ID
455- /// of the closure expression. This is a `ImplSourceUserDefined ` in spirit, but the
454+ /// of the closure expression. This is a `ImplSource::UserDefined ` in spirit, but the
456455 /// impl is generated by the compiler and does not appear in the source.
457- ImplSourceClosure ( ImplSourceClosureData < ' tcx , N > ) ,
456+ Closure ( ImplSourceClosureData < ' tcx , N > ) ,
458457
459458 /// Same as above, but for a function pointer type with the given signature.
460- ImplSourceFnPointer ( ImplSourceFnPointerData < ' tcx , N > ) ,
459+ FnPointer ( ImplSourceFnPointerData < ' tcx , N > ) ,
461460
462461 /// ImplSource for a builtin `DeterminantKind` trait implementation.
463- ImplSourceDiscriminantKind ( ImplSourceDiscriminantKindData ) ,
462+ DiscriminantKind ( ImplSourceDiscriminantKindData ) ,
464463
465464 /// ImplSource automatically generated for a generator.
466- ImplSourceGenerator ( ImplSourceGeneratorData < ' tcx , N > ) ,
465+ Generator ( ImplSourceGeneratorData < ' tcx , N > ) ,
467466
468467 /// ImplSource for a trait alias.
469- ImplSourceTraitAlias ( ImplSourceTraitAliasData < ' tcx , N > ) ,
468+ TraitAlias ( ImplSourceTraitAliasData < ' tcx , N > ) ,
470469}
471470
472471impl < ' tcx , N > ImplSource < ' tcx , N > {
473472 pub fn nested_obligations ( self ) -> Vec < N > {
474473 match self {
475- ImplSourceUserDefined ( i) => i. nested ,
476- ImplSourceParam ( n) => n,
477- ImplSourceBuiltin ( i) => i. nested ,
478- ImplSourceAutoImpl ( d) => d. nested ,
479- ImplSourceClosure ( c) => c. nested ,
480- ImplSourceGenerator ( c) => c. nested ,
481- ImplSourceObject ( d) => d. nested ,
482- ImplSourceFnPointer ( d) => d. nested ,
483- ImplSourceDiscriminantKind ( ImplSourceDiscriminantKindData ) => Vec :: new ( ) ,
484- ImplSourceTraitAlias ( d) => d. nested ,
474+ ImplSource :: UserDefined ( i) => i. nested ,
475+ ImplSource :: Param ( n) => n,
476+ ImplSource :: Builtin ( i) => i. nested ,
477+ ImplSource :: AutoImpl ( d) => d. nested ,
478+ ImplSource :: Closure ( c) => c. nested ,
479+ ImplSource :: Generator ( c) => c. nested ,
480+ ImplSource :: Object ( d) => d. nested ,
481+ ImplSource :: FnPointer ( d) => d. nested ,
482+ ImplSource :: DiscriminantKind ( ImplSourceDiscriminantKindData ) => Vec :: new ( ) ,
483+ ImplSource :: TraitAlias ( d) => d. nested ,
485484 }
486485 }
487486
488487 pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
489488 match & self {
490- ImplSourceUserDefined ( i) => & i. nested [ ..] ,
491- ImplSourceParam ( n) => & n[ ..] ,
492- ImplSourceBuiltin ( i) => & i. nested [ ..] ,
493- ImplSourceAutoImpl ( d) => & d. nested [ ..] ,
494- ImplSourceClosure ( c) => & c. nested [ ..] ,
495- ImplSourceGenerator ( c) => & c. nested [ ..] ,
496- ImplSourceObject ( d) => & d. nested [ ..] ,
497- ImplSourceFnPointer ( d) => & d. nested [ ..] ,
498- ImplSourceDiscriminantKind ( ImplSourceDiscriminantKindData ) => & [ ] ,
499- ImplSourceTraitAlias ( d) => & d. nested [ ..] ,
489+ ImplSource :: UserDefined ( i) => & i. nested [ ..] ,
490+ ImplSource :: Param ( n) => & n[ ..] ,
491+ ImplSource :: Builtin ( i) => & i. nested [ ..] ,
492+ ImplSource :: AutoImpl ( d) => & d. nested [ ..] ,
493+ ImplSource :: Closure ( c) => & c. nested [ ..] ,
494+ ImplSource :: Generator ( c) => & c. nested [ ..] ,
495+ ImplSource :: Object ( d) => & d. nested [ ..] ,
496+ ImplSource :: FnPointer ( d) => & d. nested [ ..] ,
497+ ImplSource :: DiscriminantKind ( ImplSourceDiscriminantKindData ) => & [ ] ,
498+ ImplSource :: TraitAlias ( d) => & d. nested [ ..] ,
500499 }
501500 }
502501
@@ -505,42 +504,42 @@ impl<'tcx, N> ImplSource<'tcx, N> {
505504 F : FnMut ( N ) -> M ,
506505 {
507506 match self {
508- ImplSourceUserDefined ( i) => ImplSourceUserDefined ( ImplSourceUserDefinedData {
507+ ImplSource :: UserDefined ( i) => ImplSource :: UserDefined ( ImplSourceUserDefinedData {
509508 impl_def_id : i. impl_def_id ,
510509 substs : i. substs ,
511510 nested : i. nested . into_iter ( ) . map ( f) . collect ( ) ,
512511 } ) ,
513- ImplSourceParam ( n) => ImplSourceParam ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
514- ImplSourceBuiltin ( i) => ImplSourceBuiltin ( ImplSourceBuiltinData {
512+ ImplSource :: Param ( n) => ImplSource :: Param ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
513+ ImplSource :: Builtin ( i) => ImplSource :: Builtin ( ImplSourceBuiltinData {
515514 nested : i. nested . into_iter ( ) . map ( f) . collect ( ) ,
516515 } ) ,
517- ImplSourceObject ( o) => ImplSourceObject ( ImplSourceObjectData {
516+ ImplSource :: Object ( o) => ImplSource :: Object ( ImplSourceObjectData {
518517 upcast_trait_ref : o. upcast_trait_ref ,
519518 vtable_base : o. vtable_base ,
520519 nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
521520 } ) ,
522- ImplSourceAutoImpl ( d) => ImplSourceAutoImpl ( ImplSourceAutoImplData {
521+ ImplSource :: AutoImpl ( d) => ImplSource :: AutoImpl ( ImplSourceAutoImplData {
523522 trait_def_id : d. trait_def_id ,
524523 nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
525524 } ) ,
526- ImplSourceClosure ( c) => ImplSourceClosure ( ImplSourceClosureData {
525+ ImplSource :: Closure ( c) => ImplSource :: Closure ( ImplSourceClosureData {
527526 closure_def_id : c. closure_def_id ,
528527 substs : c. substs ,
529528 nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
530529 } ) ,
531- ImplSourceGenerator ( c) => ImplSourceGenerator ( ImplSourceGeneratorData {
530+ ImplSource :: Generator ( c) => ImplSource :: Generator ( ImplSourceGeneratorData {
532531 generator_def_id : c. generator_def_id ,
533532 substs : c. substs ,
534533 nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
535534 } ) ,
536- ImplSourceFnPointer ( p) => ImplSourceFnPointer ( ImplSourceFnPointerData {
535+ ImplSource :: FnPointer ( p) => ImplSource :: FnPointer ( ImplSourceFnPointerData {
537536 fn_ty : p. fn_ty ,
538537 nested : p. nested . into_iter ( ) . map ( f) . collect ( ) ,
539538 } ) ,
540- ImplSourceDiscriminantKind ( ImplSourceDiscriminantKindData ) => {
541- ImplSourceDiscriminantKind ( ImplSourceDiscriminantKindData )
539+ ImplSource :: DiscriminantKind ( ImplSourceDiscriminantKindData ) => {
540+ ImplSource :: DiscriminantKind ( ImplSourceDiscriminantKindData )
542541 }
543- ImplSourceTraitAlias ( d) => ImplSourceTraitAlias ( ImplSourceTraitAliasData {
542+ ImplSource :: TraitAlias ( d) => ImplSource :: TraitAlias ( ImplSourceTraitAliasData {
544543 alias_def_id : d. alias_def_id ,
545544 substs : d. substs ,
546545 nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
0 commit comments