@@ -618,7 +618,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
618618
619619 /// Computes cost for the given source.
620620 ///
621- /// Sources with a small cost are prefer and should result
621+ /// Sources with a small cost are preferred and should result
622622 /// in a clearer and idiomatic suggestion.
623623 fn source_cost ( & self , source : & InferSource < ' tcx > ) -> usize {
624624 #[ derive( Clone , Copy ) ]
@@ -631,6 +631,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
631631 GenericArgKind :: Lifetime ( _) => 0 , // erased
632632 GenericArgKind :: Type ( ty) => self . ty_cost ( ty) ,
633633 GenericArgKind :: Const ( _) => 3 , // some non-zero value
634+ GenericArgKind :: Constness ( _) => 1 ,
634635 }
635636 }
636637 fn ty_cost ( self , ty : Ty < ' tcx > ) -> usize {
@@ -748,6 +749,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
748749 }
749750 match inner. unpack ( ) {
750751 GenericArgKind :: Lifetime ( _) => { }
752+ GenericArgKind :: Constness ( _) => { }
751753 GenericArgKind :: Type ( ty) => {
752754 if matches ! ( ty. kind( ) , ty:: Opaque ( ..) | ty:: Closure ( ..) | ty:: Generator ( ..) ) {
753755 // Opaque types can't be named by the user right now.
0 commit comments