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
.iter()
.filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic))
.map(|_| hir::SyntheticTyParamKind::ImplTrait)
.map(|_| hir::SyntheticTyParamKind::Rustc)
.next(),
};

View File

@ -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.

View File

@ -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,