Skip to content

Commit

Permalink
split SyntheticTyParamKind
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Oct 7, 2020
1 parent f865e3d commit 236689d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Expand Up @@ -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(),
};

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_hir/src/hir.rs
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_typeck/src/astconv/generics.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 236689d

Please sign in to comment.