about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-10-05 01:43:15 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-10-07 10:19:04 +0200
commit236689d6eb241e92bea7449c07ba55783926391f (patch)
tree43f170c574d57c7e88e98a1fe2ccf023a12c331c
parentf865e3d22f93664c85059f88ceef433718c4f2f0 (diff)
downloadrust-236689d6eb241e92bea7449c07ba55783926391f.tar.gz
rust-236689d6eb241e92bea7449c07ba55783926391f.zip
split SyntheticTyParamKind
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs2
-rw-r--r--compiler/rustc_hir/src/hir.rs2
-rw-r--r--compiler/rustc_typeck/src/astconv/generics.rs3
3 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 41e1aafd9bd..6e60191892f 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -2210,7 +2210,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                         .attrs
                         .iter()
                         .filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic))
-                        .map(|_| hir::SyntheticTyParamKind::ImplTrait)
+                        .map(|_| hir::SyntheticTyParamKind::Rustc)
                         .next(),
                 };
 
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 636f67a77c8..52d24a2eb48 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -508,6 +508,8 @@ impl Generics<'hir> {
 #[derive(HashStable_Generic)]
 pub enum SyntheticTyParamKind {
     ImplTrait,
+    // Created by the `#[rustc_synthetic]` attribute.
+    Rustc,
 }
 
 /// A where-clause in a definition.
diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs
index b867798c76c..a877dfcfcb7 100644
--- a/compiler/rustc_typeck/src/astconv/generics.rs
+++ b/compiler/rustc_typeck/src/astconv/generics.rs
@@ -550,7 +550,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         let explicit = !seg.infer_args;
         let impl_trait = generics.params.iter().any(|param| match param.kind {
             ty::GenericParamDefKind::Type {
-                synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
+                synthetic:
+                    Some(hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::Rustc),
                 ..
             } => true,
             _ => false,