1
Fork 0

forbid impl Trait in generic param defaults

This commit is contained in:
SNCPlay42 2021-04-06 16:21:08 +01:00
parent e1d49aaad4
commit ee79f83129
5 changed files with 134 additions and 66 deletions

View file

@ -2259,13 +2259,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let kind = hir::GenericParamKind::Type {
default: default.as_ref().map(|x| {
self.lower_ty(
x,
ImplTraitContext::OtherOpaqueTy {
capturable_lifetimes: &mut FxHashSet::default(),
origin: hir::OpaqueTyOrigin::Misc,
},
)
self.lower_ty(x, ImplTraitContext::Disallowed(ImplTraitPosition::Other))
}),
synthetic: param
.attrs