diff options
| author | Philipp Krones <hello@philkrones.com> | 2022-06-30 10:50:09 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2022-06-30 10:50:09 +0200 |
| commit | 09f5df5087c1d045db3bbf1b886702ec343a2f61 (patch) | |
| tree | 5f7eecd245841b64223f85e99b269c9dd3b55f18 /clippy_lints/src/utils/internal_lints | |
| parent | ee37029afa62e93ab5ec8b1f2a23f8dbfd2a453f (diff) | |
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
Diffstat (limited to 'clippy_lints/src/utils/internal_lints')
| -rw-r--r-- | clippy_lints/src/utils/internal_lints/metadata_collector.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 2564099f4db..6518e0a6ea0 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -104,7 +104,7 @@ macro_rules! RENAME_VALUE_TEMPLATE { }; } -const LINT_EMISSION_FUNCTIONS: [&[&str]; 8] = [ +const LINT_EMISSION_FUNCTIONS: [&[&str]; 7] = [ &["clippy_utils", "diagnostics", "span_lint"], &["clippy_utils", "diagnostics", "span_lint_and_help"], &["clippy_utils", "diagnostics", "span_lint_and_note"], @@ -190,7 +190,12 @@ impl MetadataCollector { lints: BinaryHeap::<LintMetadata>::default(), applicability_info: FxHashMap::<String, ApplicabilityInfo>::default(), config: collect_configs(), - clippy_project_root: clippy_dev::clippy_project_root(), + clippy_project_root: std::env::current_dir() + .expect("failed to get current dir") + .ancestors() + .nth(1) + .expect("failed to get project root") + .to_path_buf(), } } @@ -841,7 +846,7 @@ fn get_lint_level_from_group(lint_group: &str) -> Option<&'static str> { .find_map(|(group_name, group_level)| (*group_name == lint_group).then(|| *group_level)) } -fn is_deprecated_lint(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { +pub(super) fn is_deprecated_lint(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { if let hir::TyKind::Path(ref path) = ty.kind { if let hir::def::Res::Def(DefKind::Struct, def_id) = cx.qpath_res(path, ty.hir_id) { return match_def_path(cx, def_id, &DEPRECATED_LINT_TYPE); |
