]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/generics.rs
Fmt and test revert
[rust.git] / compiler / rustc_middle / src / ty / generics.rs
index ef46a41996488e4bdb3f0b282762f85e348d8005..d30a8693959f39a17a7c381fb702fa8bcc9792be 100644 (file)
@@ -120,10 +120,12 @@ pub fn own_defaults(&self) -> GenericParamCount {
         for param in &self.params {
             match param.kind {
                 GenericParamDefKind::Lifetime => (),
-                GenericParamDefKind::Type { has_default, .. } |
-                GenericParamDefKind::Const { has_default } => {
+                GenericParamDefKind::Type { has_default, .. } => {
                     own_defaults.types += has_default as usize;
                 }
+                GenericParamDefKind::Const { has_default } => {
+                    own_defaults.consts += has_default as usize;
+                }
             }
         }
 
@@ -146,7 +148,9 @@ pub fn requires_monomorphization(&self, tcx: TyCtxt<'tcx>) -> bool {
     pub fn own_requires_monomorphization(&self) -> bool {
         for param in &self.params {
             match param.kind {
-                GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => return true,
+                GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => {
+                    return true;
+                }
                 GenericParamDefKind::Lifetime => {}
             }
         }