rustc: Error messages feel like they're backwards #53965
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-frontend
Area: Compiler frontend (errors, parsing and HIR)
WG-diagnostics
Working group: Diagnostics
This code snippet illustrates a problem I've always had with the Rust compiler's error messages:
The compiler error is:
Intuitively, for me,
found
andexpected
are swapped. I expect the function to be the point of reference, and therefore theexpected
value and I expect the call site to be the candidate, and therefore thefound
value. However it seems reverse. Above you can see theexpected
type is the call site's&[&[u8; 1]; 1]
and thefound
type is the function's[_]
. I this often slows me down when chasing compile errors as I have to stop and mentally reverse my perception about expected and found.I hesitate to call this a bug, as I think it's a matter of opinion. But it does feel the opposite of intuitive for me.
The text was updated successfully, but these errors were encountered: