@@ -618,7 +618,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
618
618
619
619
/// Computes cost for the given source.
620
620
///
621
- /// Sources with a small cost are prefer and should result
621
+ /// Sources with a small cost are preferred and should result
622
622
/// in a clearer and idiomatic suggestion.
623
623
fn source_cost ( & self , source : & InferSource < ' tcx > ) -> usize {
624
624
#[ derive( Clone , Copy ) ]
@@ -631,6 +631,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
631
631
GenericArgKind :: Lifetime ( _) => 0 , // erased
632
632
GenericArgKind :: Type ( ty) => self . ty_cost ( ty) ,
633
633
GenericArgKind :: Const ( _) => 3 , // some non-zero value
634
+ GenericArgKind :: Constness ( _) => 1 ,
634
635
}
635
636
}
636
637
fn ty_cost ( self , ty : Ty < ' tcx > ) -> usize {
@@ -748,6 +749,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
748
749
}
749
750
match inner. unpack ( ) {
750
751
GenericArgKind :: Lifetime ( _) => { }
752
+ GenericArgKind :: Constness ( _) => { }
751
753
GenericArgKind :: Type ( ty) => {
752
754
if matches ! ( ty. kind( ) , ty:: Opaque ( ..) | ty:: Closure ( ..) | ty:: Generator ( ..) ) {
753
755
// Opaque types can't be named by the user right now.
0 commit comments