Skip to content

Commit 9b93be1

Browse files
committed
Add note to fix MATCH_TYPE_ON_DIAG_ITEM
1 parent fc72c16 commit 9b93be1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clippy_lints/src/utils/internal_lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ impl<'tcx> LateLintPass<'tcx> for MatchTypeOnDiagItem {
770770
let diag_items = cx.tcx.diagnostic_items(ty_did.krate);
771771
if let Some(item_name) = diag_items.iter().find_map(|(k, v)| if *v == ty_did { Some(k) } else { None });
772772
then {
773+
// TODO: check paths constants from external crates.
773774
let cx_snippet = snippet(cx, context.span, "_");
774775
let ty_snippet = snippet(cx, ty.span, "_");
775776

tests/ui-internal/match_type_on_diag_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
2727
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr) {
2828
let ty = cx.typeck_results().expr_ty(expr);
2929

30-
let _ = match_type(cx, ty, &paths::VEC);
30+
let _ = match_type(cx, ty, &paths::VEC); // FIXME: Doesn't lint external paths
3131
let _ = match_type(cx, ty, &OPTION);
3232
let _ = match_type(cx, ty, &["core", "result", "Result"]);
3333

0 commit comments

Comments
 (0)