-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Labels
Description
Something we might start to think about doing is for every error diagnostic have some kind of class for them all, so we can enforce good error messages so for example we might have:
class ErrorDiagnostics {
static void StaticMutableUnsafe(Location) { }
}
Originally posted by @philberty in #1417 (review)
I think a good interface would be the following:
class Emittable {
Location locus;
std::string msg;
unsigned error_code;
void emit() {
rust_error_at(locus, msg); // or similar
}
}
class ErrorStaticMutableUnsafe: public Emittable {
/* ... */
}
I wonder if there is something we can do better with an enum class
or similar