You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of hard-coding these in, we could compute them using the discriminant.
Compile-time guarantee there aren't any duplicate error codes.
Right now, it's up to us to make sure we don't pass the same error code for two different enums.
But if we used discriminants, the Rust compiler ensures there's no duplicate values for us.
The text was updated successfully, but these errors were encountered:
Doing this would present 2 advantages:
slicec/src/diagnostics/errors.rs
Line 268 in fabd9d9
Right now, it's up to us to make sure we don't pass the same error code for two different enums.
But if we used discriminants, the Rust compiler ensures there's no duplicate values for us.
The text was updated successfully, but these errors were encountered: