@@ -4,7 +4,7 @@ error: repeated calls to `Ty::is_diag_item`
44LL | let _ = ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
7- = note: this calls `TyCtxt::is_diagnostic_item` internally, which is expensive
7+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
88 = note: `-D clippy::repeated-is-diagnostic-item` implied by `-D warnings`
99 = help: to override `-D warnings` add `#[allow(clippy::repeated_is_diagnostic_item)]`
1010help: call `Ty::opt_diag_name`, and reuse the results
@@ -19,7 +19,7 @@ error: repeated calls to `Ty::is_diag_item`
1919LL | let _ = !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result);
2020 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2121 |
22- = note: this calls `TyCtxt::is_diagnostic_item` internally, which is expensive
22+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
2323help: call `Ty::opt_diag_name`, and reuse the results
2424 |
2525LL - let _ = !ty.is_diag_item(cx, sym::Option) && !ty.is_diag_item(cx, sym::Result);
@@ -32,7 +32,7 @@ error: repeated calls to `AdtDef::is_diag_item`
3232LL | let _ = adt_def.is_diag_item(cx, sym::Option) || adt_def.is_diag_item(cx, sym::Result);
3333 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434 |
35- = note: this calls `TyCtxt::is_diagnostic_item` internally, which is expensive
35+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
3636help: call `AdtDef::opt_diag_name`, and reuse the results
3737 |
3838LL - let _ = adt_def.is_diag_item(cx, sym::Option) || adt_def.is_diag_item(cx, sym::Result);
@@ -45,7 +45,7 @@ error: repeated calls to `AdtDef::is_diag_item`
4545LL | let _ = !adt_def.is_diag_item(cx, sym::Option) && !adt_def.is_diag_item(cx, sym::Result);
4646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4747 |
48- = note: this calls `TyCtxt::is_diagnostic_item` internally, which is expensive
48+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
4949help: call `AdtDef::opt_diag_name`, and reuse the results
5050 |
5151LL - let _ = !adt_def.is_diag_item(cx, sym::Option) && !adt_def.is_diag_item(cx, sym::Result);
@@ -58,7 +58,7 @@ error: repeated calls to `TyCtxt::is_diagnostic_item`
5858LL | let _ = cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did);
5959 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060 |
61- = note: this calls an expensive compiler query
61+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
6262help: call `TyCtxt::get_diagnostic_name`, and reuse the results
6363 |
6464LL - let _ = cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did);
@@ -71,7 +71,7 @@ error: repeated calls to `TyCtxt::is_diagnostic_item`
7171LL | let _ = !cx.tcx.is_diagnostic_item(sym::Option, did) && !cx.tcx.is_diagnostic_item(sym::Result, did);
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7373 |
74- = note: this calls an expensive compiler query
74+ = note: each call performs the same compiler query -- it's faster to query once, and reuse the results
7575help: call `TyCtxt::get_diagnostic_name`, and reuse the results
7676 |
7777LL - let _ = !cx.tcx.is_diagnostic_item(sym::Option, did) && !cx.tcx.is_diagnostic_item(sym::Result, did);
0 commit comments