diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-25 19:16:38 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-30 15:00:52 +0300 |
| commit | 64b6b5b6ce078684dea0d312e3ac0911e1d6a0df (patch) | |
| tree | 0855baa9a6a74ccced8920fea0c6bf01bb0c68b8 /src | |
| parent | c401f099795231fca8adf6619d76ccdcfbbfd2f9 (diff) | |
| download | rust-64b6b5b6ce078684dea0d312e3ac0911e1d6a0df.tar.gz rust-64b6b5b6ce078684dea0d312e3ac0911e1d6a0df.zip | |
hir: Simplify `hir_owner_nodes` query
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/min_ident_chars.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/min_ident_chars.rs b/src/tools/clippy/clippy_lints/src/min_ident_chars.rs index 34b8e0dbe6a..2b0063f62d9 100644 --- a/src/tools/clippy/clippy_lints/src/min_ident_chars.rs +++ b/src/tools/clippy/clippy_lints/src/min_ident_chars.rs @@ -93,7 +93,7 @@ impl Visitor<'_> for IdentVisitor<'_, '_> { // reimplement it even if we wanted to cx.tcx.opt_hir_node(hir_id) } else { - let Some(owner) = cx.tcx.hir_owner_nodes(hir_id.owner).as_owner() else { + let Some(owner) = cx.tcx.opt_hir_owner_nodes(hir_id.owner) else { return; }; owner.nodes.get(hir_id.local_id).copied().flatten().map(|p| p.node) |
