Skip to content

Commit a844d58

Browse files
committed
fix(linter): Update dylint and related dependencies
1 parent c05ccec commit a844d58

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

nova_lint/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ name = "gc_scope_is_only_passed_by_value"
2525
path = "ui/gc_scope_is_only_passed_by_value.rs"
2626

2727
[dependencies]
28-
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ff4a26d442bead94a4c96fb1de967374bc4fbd8e" }
29-
dylint_linting = { version = "4.0.0", features = ["constituent"] }
28+
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "0450db33a5d8587f7c1d4b6d233dac963605766b" }
29+
dylint_linting = { version = "4.1.0", features = ["constituent"] }
3030

3131
[dev-dependencies]
32-
dylint_testing = "4.0.0"
32+
dylint_testing = "4.1.0"
3333
nova_vm = { path = "../nova_vm" }
3434

3535
[package.metadata.rust-analyzer]

nova_lint/src/utils.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1-
use clippy_utils::match_def_path;
1+
use rustc_hir::def_id::DefId;
22
use rustc_lint::LateContext;
33
use rustc_middle::ty::{Ty, TyKind};
4+
use rustc_span::symbol::Symbol;
5+
6+
// Copyright (c) 2014-2025 The Rust Project Developers
7+
//
8+
// Originally copied from `dylint` which in turn copied it from `clippy_utils`:
9+
// - https://github.com/trailofbits/dylint/blob/a2dd5c60d53d66fc791fa8184bed27a4cb142e74/internal/src/match_def_path.rs
10+
// - https://github.com/rust-lang/rust-clippy/blob/f62f26965817f2573c2649288faa489a03ed1665/clippy_utils/src/lib.rs
11+
// It was removed from `clippy_utils` by the following PR:
12+
// - https://github.com/rust-lang/rust-clippy/pull/14705
13+
/// Checks if the given `DefId` matches the path.
14+
pub fn match_def_path(cx: &LateContext<'_>, did: DefId, syms: &[&str]) -> bool {
15+
// We should probably move to Symbols in Clippy as well rather than interning every time.
16+
let path = cx.get_def_path(did);
17+
syms.iter()
18+
.map(|x| Symbol::intern(x))
19+
.eq(path.iter().copied())
20+
}
421

522
pub fn is_param_ty(ty: &Ty) -> bool {
623
matches!(ty.kind(), TyKind::Param(_))

0 commit comments

Comments
 (0)