diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-10-23 12:51:06 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-10-23 12:51:06 -0700 |
| commit | f71e9ed7f1b88f303519dcd7c2cc69117ff95094 (patch) | |
| tree | e486557aeb2ed52041b9a0c80ae36fe477166f19 | |
| parent | b334eef162ba9c10faa97c9d5c5d249f25afc7df (diff) | |
| download | rust-f71e9ed7f1b88f303519dcd7c2cc69117ff95094.tar.gz rust-f71e9ed7f1b88f303519dcd7c2cc69117ff95094.zip | |
review comments
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/codegen.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 19 |
2 files changed, 10 insertions, 14 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs index 05e6c4804ff..3cb6ec86261 100644 --- a/compiler/rustc_trait_selection/src/traits/codegen.rs +++ b/compiler/rustc_trait_selection/src/traits/codegen.rs @@ -121,7 +121,10 @@ where // contains unbound type parameters. It could be a slight // optimization to stop iterating early. if let Err(errors) = fulfill_cx.select_all_or_error(infcx) { - bug!("Encountered errors `{:?}` resolving bounds after type-checking", errors); + infcx.tcx.sess.delay_span_bug( + rustc_span::DUMMY_SP, + &format!("Encountered errors `{:?}` resolving bounds after type-checking", errors), + ); } let result = infcx.resolve_vars_if_possible(result); diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index d4124c82197..4cc4bc0acda 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2031,19 +2031,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { &predicate.subst(tcx, substs), &mut obligations, ); - if predicate.references_error() { - self.tcx().sess.delay_span_bug( - cause.span, - &format!("impl_or_trait_obligation with errors: {:?}", predicate), - ); - } else { - obligations.push(Obligation { - cause: cause.clone(), - recursion_depth, - param_env, - predicate, - }); - } + obligations.push(Obligation { + cause: cause.clone(), + recursion_depth, + param_env, + predicate, + }); } // We are performing deduplication here to avoid exponential blowups |
