Skip to content

Commit a2ddcb3

Browse files
committed
Small cleanups
1 parent 7bdb059 commit a2ddcb3

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ fn check_for_cycles(
154154
{
155155
def_id = delegation_info.resolution_id;
156156
if visited.contains(&def_id) {
157-
// We encountered a cycle in the resolution, or delegation callee refers to non-existent
158-
// entity, in this case emit an error.
159157
return Err(tcx.dcx().emit_err(CycleInDelegationSignatureResolution { span }));
160158
}
161159
} else {

compiler/rustc_resolve/src/late.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,11 +3900,11 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
39003900
this.visit_path(&delegation.path);
39013901
});
39023902

3903-
let resolution_id = if is_in_trait_impl { item_id } else { delegation.id };
3903+
let resolution_node_id = if is_in_trait_impl { item_id } else { delegation.id };
39043904
let def_id = self
39053905
.r
39063906
.partial_res_map
3907-
.get(&resolution_id)
3907+
.get(&resolution_node_id)
39083908
.and_then(|r| r.expect_full_res().opt_def_id());
39093909

39103910
let resolution = if let Some(resolution_id) = def_id
@@ -3917,7 +3917,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
39173917
self.r.tcx.dcx().span_delayed_bug(
39183918
delegation.path.span,
39193919
format!(
3920-
"LoweringContext: couldn't resolve node {resolution_id:?} in delegation item",
3920+
"LateResolutionVisitor: couldn't resolve node {resolution_node_id:?} in delegation item",
39213921
),
39223922
);
39233923

0 commit comments

Comments
 (0)