1
Fork 0

split SyntheticTyParamKind

This commit is contained in:
Bastian Kauschke 2020-10-05 01:43:15 +02:00
parent f865e3d22f
commit 236689d6eb
3 changed files with 5 additions and 2 deletions

View file

@ -2210,7 +2210,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
.attrs .attrs
.iter() .iter()
.filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic)) .filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic))
.map(|_| hir::SyntheticTyParamKind::ImplTrait) .map(|_| hir::SyntheticTyParamKind::Rustc)
.next(), .next(),
}; };

View file

@ -508,6 +508,8 @@ impl Generics<'hir> {
#[derive(HashStable_Generic)] #[derive(HashStable_Generic)]
pub enum SyntheticTyParamKind { pub enum SyntheticTyParamKind {
ImplTrait, ImplTrait,
// Created by the `#[rustc_synthetic]` attribute.
Rustc,
} }
/// A where-clause in a definition. /// A where-clause in a definition.

View file

@ -550,7 +550,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let explicit = !seg.infer_args; let explicit = !seg.infer_args;
let impl_trait = generics.params.iter().any(|param| match param.kind { let impl_trait = generics.params.iter().any(|param| match param.kind {
ty::GenericParamDefKind::Type { ty::GenericParamDefKind::Type {
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait), synthetic:
Some(hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::Rustc),
.. ..
} => true, } => true,
_ => false, _ => false,