Uh oh!
There was an error while loading. Please reload this page.
Remove duplicated errors for closure type mismatch - #41760
Conversation
rust-highfive
commented
May 5, 2017
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
commented
May 5, 2017
| .map_err(|e| OutputTypeParameterMismatch(expected_trait_ref, obligation_trait_ref, e)) | ||
| .map_err(|e| { | ||
| let self_ty = expected_trait_ref.self_ty(); | ||
| match (&self_ty.sty, &e) { |
There was a problem hiding this comment.
Can you please just compare the # of parameters in the fn sig vs. the # of parameters in the obligation (that's obligation.predicate.skip_binder().subst_at(1))?
| { | ||
| let span = obligation.cause.span; | ||
| if !self.reported_selection_errors.borrow_mut().insert((span, error.clone())) { |
There was a problem hiding this comment.
This sounds overly excessive. Outside of closures all trait errors are Unimplemented, so you are only showing 1 error per span.
There was a problem hiding this comment.
Yeah, it was surprising to me how many tests were affected by this. I'll think of a different way to deduplicate these errors...
Originally I was trying to get to the point where only one of FnMut and FnOnce were required, which feels like the correct way to accomplish this, but could not find where to tackle that (even pouring through the code and with full debugging output on :-/ ).
estebank
commented
May 8, 2017
Superseded by #41840. |
Follow up to #41488.