about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-08 11:44:45 +0000
committerbors <bors@rust-lang.org>2021-10-08 11:44:45 +0000
commite0aaffd8a45cd0e9f331ec7734713e9de11aa6c8 (patch)
tree11385f103f96e0bcc09ccf85b4b77e7351fd87d1 /src/librustdoc
parent44995f7afb18775913618ae50601be31b9f9dead (diff)
parent0950d5afe227c7097e59bf797a85267d3a659744 (diff)
downloadrust-e0aaffd8a45cd0e9f331ec7734713e9de11aa6c8.tar.gz
rust-e0aaffd8a45cd0e9f331ec7734713e9de11aa6c8.zip
Auto merge of #89576 - tom7980:issue-89275-fix, r=estebank
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions

Closes #89275

This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait.

Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/clean/blanket_impl.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs
index 8135d4a2085..c2c1d369d6e 100644
--- a/src/librustdoc/clean/blanket_impl.rs
+++ b/src/librustdoc/clean/blanket_impl.rs
@@ -78,7 +78,8 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
                             );
                             match infcx.evaluate_obligation(&obligation) {
                                 Ok(eval_result) if eval_result.may_apply() => {}
-                                Err(traits::OverflowError) => {}
+                                Err(traits::OverflowError::Cannonical) => {}
+                                Err(traits::OverflowError::ErrorReporting) => {}
                                 _ => {
                                     return false;
                                 }