diff options
| author | mejrs <> | 2022-11-19 13:31:51 +0100 |
|---|---|---|
| committer | mejrs <> | 2022-11-29 17:33:51 +0100 |
| commit | b209ff27f32425e0d3a6ae704669a617f2f2235a (patch) | |
| tree | 3cf84baa52759f3491153fe7a2391a51f4fb0128 | |
| parent | 4ced370f7c03dad99c74ceb4b86a0538b970690a (diff) | |
| download | rust-b209ff27f32425e0d3a6ae704669a617f2f2235a.tar.gz rust-b209ff27f32425e0d3a6ae704669a617f2f2235a.zip | |
Update trait check
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 1ea41098413..4a0da9927c6 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -769,10 +769,13 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations { // We shouldn't recommend implementing `Copy` on stateful things, // such as iterators. if let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator) { - if cx.tcx.infer_ctxt().enter(|infer_ctxt| { - infer_ctxt.type_implements_trait(iter_trait, ty, List::empty(), param_env) - == EvaluationResult::EvaluatedToOk - }) { + if cx.tcx.infer_ctxt().build().type_implements_trait( + iter_trait, + ty, + List::empty(), + param_env, + ) == EvaluationResult::EvaluatedToOk + { return; } } |
