1
Fork 0

Remove Session.trait_methods_not_found

Instead, avoid registering the problematic well-formed obligation
to begin with. This removes global untracked mutable state,
and avoids potential issues with incremental compilation.
This commit is contained in:
Aaron Hill 2021-08-21 18:45:56 -05:00
parent b6e334d873
commit 41f9f38d6e
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 23 additions and 15 deletions

View file

@ -104,11 +104,5 @@ pub fn report_object_safety_error(
to be resolvable dynamically; for more information visit \
<https://doc.rust-lang.org/reference/items/traits.html#object-safety>",
);
if tcx.sess.trait_methods_not_found.borrow().iter().any(|full_span| full_span.contains(span)) {
// Avoid emitting error caused by non-existing method (#58734)
err.cancel();
}
err
}