Skip to content

Commit 236689d

Browse files
committed
split SyntheticTyParamKind
1 parent f865e3d commit 236689d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22102210
.attrs
22112211
.iter()
22122212
.filter(|attr| self.sess.check_name(attr, sym::rustc_synthetic))
2213-
.map(|_| hir::SyntheticTyParamKind::ImplTrait)
2213+
.map(|_| hir::SyntheticTyParamKind::Rustc)
22142214
.next(),
22152215
};
22162216

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ impl Generics<'hir> {
508508
#[derive(HashStable_Generic)]
509509
pub enum SyntheticTyParamKind {
510510
ImplTrait,
511+
// Created by the `#[rustc_synthetic]` attribute.
512+
Rustc,
511513
}
512514

513515
/// A where-clause in a definition.

compiler/rustc_typeck/src/astconv/generics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
550550
let explicit = !seg.infer_args;
551551
let impl_trait = generics.params.iter().any(|param| match param.kind {
552552
ty::GenericParamDefKind::Type {
553-
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
553+
synthetic:
554+
Some(hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::Rustc),
554555
..
555556
} => true,
556557
_ => false,

0 commit comments

Comments
 (0)