split SyntheticTyParamKind
This commit is contained in:
parent
f865e3d22f
commit
236689d6eb
3 changed files with 5 additions and 2 deletions
|
@ -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(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue