Special case 'generic param from outer item' message for Self

This commit is contained in:
clubby789 2024-01-13 19:24:52 +00:00
parent 511bf6e1c7
commit 2cfc81766c
8 changed files with 20 additions and 11 deletions

View file

@ -568,12 +568,14 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
DefKind::Const => Some(errs::GenericParamsFromOuterItemStaticOrConst::Const),
_ => None,
};
let is_self = matches!(outer_res, Res::SelfTyParam { .. } | Res::SelfTyAlias { .. });
let mut err = errs::GenericParamsFromOuterItem {
span,
label: None,
refer_to_type_directly: None,
sugg: None,
static_or_const,
is_self,
};
let sm = self.tcx.sess.source_map();