Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 88c1c3c

Browse files
committedOct 18, 2024
Auto merge of rust-lang#131846 - cuviper:beta-next, r=cuviper
[beta] stage0 bump and backports - Bump stage0 to 1.82.0 - Clippy: Move `too_long_first_doc_paragraph` to `nursery` rust-lang#131742 - Also use outermost const-anon for impl items in `non_local_defs` lint rust-lang#131660 r? ghost
2 parents 0125edf + d04ae76 commit 88c1c3c

File tree

5 files changed

+378
-456
lines changed

5 files changed

+378
-456
lines changed
 

‎compiler/rustc_lint/src/non_local_def.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,13 @@ fn did_has_local_parent(
301301
return false;
302302
};
303303

304-
peel_parent_while(tcx, parent_did, |tcx, did| tcx.def_kind(did) == DefKind::Mod)
305-
.map(|parent_did| parent_did == impl_parent || Some(parent_did) == outermost_impl_parent)
306-
.unwrap_or(false)
304+
peel_parent_while(tcx, parent_did, |tcx, did| {
305+
tcx.def_kind(did) == DefKind::Mod
306+
|| (tcx.def_kind(did) == DefKind::Const
307+
&& tcx.opt_item_name(did) == Some(kw::Underscore))
308+
})
309+
.map(|parent_did| parent_did == impl_parent || Some(parent_did) == outermost_impl_parent)
310+
.unwrap_or(false)
307311
}
308312

309313
/// Given a `DefId` checks if it satisfies `f` if it does check with it's parent and continue
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.