Validate resolution for SelfCtor too.

This commit is contained in:
Camille GILLOT 2023-04-30 16:05:09 +00:00
parent 89158e210c
commit 83453408a0
4 changed files with 55 additions and 2 deletions

View file

@ -550,7 +550,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let sm = self.tcx.sess.source_map();
let def_id = match outer_res {
Res::SelfTyParam { .. } => {
Res::SelfTyParam { .. } | Res::SelfCtor(_) => {
err.span_label(span, "can't use `Self` here");
return err;
}