We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcc0e8f commit 9fd8e10Copy full SHA for 9fd8e10
clippy_lints/src/utils/mod.rs
@@ -323,6 +323,11 @@ pub fn implements_trait<'a, 'tcx>(
323
trait_id: DefId,
324
ty_params: &[GenericArg<'tcx>],
325
) -> bool {
326
+ // Do not check on infer_types to avoid panic in evaluate_obligation.
327
+ if ty.has_infer_types() {
328
+ return false;
329
+ }
330
+ let ty = cx.tcx.erase_regions(&ty);
331
let ty_params = cx.tcx.mk_substs(ty_params.iter());
332
cx.tcx.type_implements_trait((trait_id, ty, ty_params, cx.param_env))
333
}
0 commit comments