Check bounds when looking up type parameters#13480
Conversation
src/librustc/util/ppaux.rs
Outdated
There was a problem hiding this comment.
So this is allowed to happen now?
There was a problem hiding this comment.
No, it is just needed in the error message. BUG[0] is way too ugly.
There was a problem hiding this comment.
E.g., otherwise the first error in the test would be "ERROR mismatched types: expected uint but found BUG[0]."
There was a problem hiding this comment.
I mean, the comment "this should not happen" implies that this code path should never be hit, but this patch is now using it for legitimate error-reporting purposes.
The fact that the comment exists implies that it's expected that this sort of error is handled/reported elsewhere. Of course, it may be that this expectation is now incorrect, and that this is the correct codepath for the error. (In which case, the comment should be removed.)
There was a problem hiding this comment.
Indeed, I think this can happen. The comment has been changed accordingly.
A mismatched type with more type parameters than the expected one causes `typeck` looking up out of the bound of type parameter vector, which leads to ICE. Closes rust-lang#13466
A mismatched type with more type parameters than the expected one causes `typeck` looking up out of the bound of type parameter vector, which leads to ICE. Closes #13466
A mismatched type with more type parameters than the expected one causes
typecklooking up out of the bound of type parameter vector, whichleads to ICE.
Closes #13466