]> git.lizzy.rs Git - rust.git/commitdiff
split SyntheticTyParamKind
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Sun, 4 Oct 2020 23:43:15 +0000 (01:43 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Wed, 7 Oct 2020 08:19:04 +0000 (10:19 +0200)
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_hir/src/hir.rs
compiler/rustc_typeck/src/astconv/generics.rs

index 41e1aafd9bdad0acfcdd516b4d37fcb9eb2b8de0..6e60191892f21d8305143b47b9e57d44f5018a68 100644 (file)
@@ -2210,7 +2210,7 @@ fn lower_generic_param(
                         .attrs
                         .iter()
                         .filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic))
-                        .map(|_| hir::SyntheticTyParamKind::ImplTrait)
+                        .map(|_| hir::SyntheticTyParamKind::Rustc)
                         .next(),
                 };
 
index 636f67a77c890a4035373c58d5550110d106948c..52d24a2eb48211a63a6fa48b00a436238ae343a4 100644 (file)
@@ -508,6 +508,8 @@ pub fn spans(&self) -> MultiSpan {
 #[derive(HashStable_Generic)]
 pub enum SyntheticTyParamKind {
     ImplTrait,
+    // Created by the `#[rustc_synthetic]` attribute.
+    Rustc,
 }
 
 /// A where-clause in a definition.
index b867798c76cf77f0a7cb95c1c0d1e74193896516..a877dfcfcb753d587eb9ebe68468bdc71516264d 100644 (file)
@@ -550,7 +550,8 @@ pub(crate) fn check_impl_trait(
         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,