[ty] Require that implementors of Constraints also implement Debug (#20348)

The debug representation isn't as useful as calling `.display(db)`, but
it's still kind-of annoying when `dbg!()` calls don't compile locally
due to the compiler not being able to guarantee that an object of type
`impl Constraints` implements `Debug`
This commit is contained in:
Alex Waygood 2025-09-11 14:34:40 +01:00 committed by GitHub
parent 59c8fda3f8
commit 89f17467ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,7 +111,7 @@ fn incomparable<'db>(db: &'db dyn Db, left: Type<'db>, right: Type<'db>) -> bool
}
/// Encodes the constraints under which a type property (e.g. assignability) holds.
pub(crate) trait Constraints<'db>: Clone + Sized {
pub(crate) trait Constraints<'db>: Clone + Sized + std::fmt::Debug {
/// Returns a constraint set that never holds
fn unsatisfiable(db: &'db dyn Db) -> Self;