Skip to content

Commit 5f29a13

Browse files
committed
Change the "dummy self type".
Because this is the only occurrence of a `Res::SelfTy` with `None` and `None` fields, and the next commit will rely on those not being present.
1 parent 307dd93 commit 5f29a13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_resolve/src/late.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
1919
use rustc_errors::DiagnosticId;
2020
use rustc_hir::def::Namespace::{self, *};
2121
use rustc_hir::def::{self, CtorKind, DefKind, LifetimeRes, PartialRes, PerNS};
22-
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID};
22+
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
2323
use rustc_hir::{BindingAnnotation, PrimTy, TraitCandidate};
2424
use rustc_middle::middle::resolve_lifetime::Set1;
2525
use rustc_middle::ty::DefIdTree;
@@ -2576,7 +2576,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
25762576
},
25772577
|this| {
25782578
// Dummy self type for better errors if `Self` is used in the trait path.
2579-
this.with_self_rib(Res::SelfTy { trait_: None, alias_to: None }, |this| {
2579+
this.with_self_rib(Res::SelfTy { trait_: Some(LOCAL_CRATE.as_def_id()), alias_to: None }, |this| {
25802580
this.with_lifetime_rib(
25812581
LifetimeRibKind::AnonymousCreateParameter {
25822582
binder: item_id,

0 commit comments

Comments
 (0)