Skip to content

Commit

Permalink
Auto merge of rust-lang#131846 - cuviper:beta-next, r=cuviper
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
bors committed Oct 18, 2024
2 parents 0125edf + d04ae76 commit 88c1c3c
Show file tree
Hide file tree
Showing 5 changed files with 378 additions and 456 deletions.
10 changes: 7 additions & 3 deletions compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,13 @@ fn did_has_local_parent(
return false;
};

peel_parent_while(tcx, parent_did, |tcx, did| tcx.def_kind(did) == DefKind::Mod)
.map(|parent_did| parent_did == impl_parent || Some(parent_did) == outermost_impl_parent)
.unwrap_or(false)
peel_parent_while(tcx, parent_did, |tcx, did| {
tcx.def_kind(did) == DefKind::Mod
|| (tcx.def_kind(did) == DefKind::Const
&& tcx.opt_item_name(did) == Some(kw::Underscore))
})
.map(|parent_did| parent_did == impl_parent || Some(parent_did) == outermost_impl_parent)
.unwrap_or(false)
}

/// Given a `DefId` checks if it satisfies `f` if it does check with it's parent and continue
Expand Down
Loading

0 comments on commit 88c1c3c

Please sign in to comment.