Update trait check
This commit is contained in:
parent
4ced370f7c
commit
b209ff27f3
1 changed files with 7 additions and 4 deletions
|
@ -769,10 +769,13 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
|
||||||
// We shouldn't recommend implementing `Copy` on stateful things,
|
// We shouldn't recommend implementing `Copy` on stateful things,
|
||||||
// such as iterators.
|
// such as iterators.
|
||||||
if let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator) {
|
if let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator) {
|
||||||
if cx.tcx.infer_ctxt().enter(|infer_ctxt| {
|
if cx.tcx.infer_ctxt().build().type_implements_trait(
|
||||||
infer_ctxt.type_implements_trait(iter_trait, ty, List::empty(), param_env)
|
iter_trait,
|
||||||
== EvaluationResult::EvaluatedToOk
|
ty,
|
||||||
}) {
|
List::empty(),
|
||||||
|
param_env,
|
||||||
|
) == EvaluationResult::EvaluatedToOk
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue