1
Fork 0

Rollup merge of #111557 - cjgillot:revert-111020, r=petrochenkov

Revert "Validate resolution for SelfCtor too."

This reverts commit 83453408a0.

That PR introduced a breaking change.

Fixes https://github.com/rust-lang/rust/issues/111541
Reopens https://github.com/rust-lang/rust/issues/89868

r? `@petrochenkov`
This commit is contained in:
Dylan DPC 2023-05-17 19:11:54 +05:30 committed by GitHub
commit ff364b0082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 55 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::SelfCtor(_) => {
Res::SelfTyParam { .. } => {
err.span_label(span, "can't use `Self` here");
return err;
}

View file

@ -1174,10 +1174,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
return Res::Err;
}
}
Res::Def(DefKind::TyParam, _)
| Res::SelfTyParam { .. }
| Res::SelfTyAlias { .. }
| Res::SelfCtor(_) => {
Res::Def(DefKind::TyParam, _) | Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } => {
for rib in ribs {
let has_generic_params: HasGenericParams = match rib.kind {
RibKind::Normal