diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-05 01:43:15 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-10-07 10:19:04 +0200 |
| commit | 236689d6eb241e92bea7449c07ba55783926391f (patch) | |
| tree | 43f170c574d57c7e88e98a1fe2ccf023a12c331c | |
| parent | f865e3d22f93664c85059f88ceef433718c4f2f0 (diff) | |
| download | rust-236689d6eb241e92bea7449c07ba55783926391f.tar.gz rust-236689d6eb241e92bea7449c07ba55783926391f.zip | |
split SyntheticTyParamKind
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/astconv/generics.rs | 3 |
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, |
