File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ name = "gc_scope_is_only_passed_by_value"
25
25
path = " ui/gc_scope_is_only_passed_by_value.rs"
26
26
27
27
[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" ] }
30
30
31
31
[dev-dependencies ]
32
- dylint_testing = " 4.0 .0"
32
+ dylint_testing = " 4.1 .0"
33
33
nova_vm = { path = " ../nova_vm" }
34
34
35
35
[package .metadata .rust-analyzer ]
Original file line number Diff line number Diff line change 1
- use clippy_utils :: match_def_path ;
1
+ use rustc_hir :: def_id :: DefId ;
2
2
use rustc_lint:: LateContext ;
3
3
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
+ }
4
21
5
22
pub fn is_param_ty ( ty : & Ty ) -> bool {
6
23
matches ! ( ty. kind( ) , TyKind :: Param ( _) )
You can’t perform that action at this time.
0 commit comments