about summary refs log tree commit diff
path: root/compiler/rustc_passes
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2020-12-30 15:34:53 +0000
committerkadmin <julianknodt@gmail.com>2021-03-23 17:16:20 +0000
commit8ef81388e2def7b12d3b527705bf32402c8d7c8a (patch)
treec9aa6da68f23fcf67e738005809e476de4887eba /compiler/rustc_passes
parente4e5db4e4207e21c38c07640d44005dab022f1b8 (diff)
downloadrust-8ef81388e2def7b12d3b527705bf32402c8d7c8a.tar.gz
rust-8ef81388e2def7b12d3b527705bf32402c8d7c8a.zip
Some refactoring
Diffstat (limited to 'compiler/rustc_passes')
-rw-r--r--compiler/rustc_passes/src/stability.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs
index dd9cb51c858..8a6ac843534 100644
--- a/compiler/rustc_passes/src/stability.rs
+++ b/compiler/rustc_passes/src/stability.rs
@@ -507,10 +507,9 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
 
     fn visit_generic_param(&mut self, p: &'tcx hir::GenericParam<'tcx>) {
         let kind = match &p.kind {
-            // FIXME(const_generics_defaults)
-            hir::GenericParamKind::Type { default, .. } if default.is_some() => {
-                AnnotationKind::Container
-            }
+            // Allow stability attributes on default generic arguments.
+            hir::GenericParamKind::Type { default: Some(_), .. }
+            | hir::GenericParamKind::Const { default: Some(_), .. } => AnnotationKind::Container,
             _ => AnnotationKind::Prohibited,
         };