File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,20 @@ pub struct SolutionDisplay<'a, I: Interner> {
159
159
}
160
160
161
161
impl < ' a , I : Interner > fmt:: Display for SolutionDisplay < ' a , I > {
162
+ #[ rustfmt:: skip]
162
163
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> Result < ( ) , fmt:: Error > {
163
164
let SolutionDisplay { solution, interner } = self ;
164
165
match solution {
165
- Solution :: Unique ( constrained) => {
166
- write ! ( f, "Unique; {}" , constrained. display( * interner) )
167
- }
166
+ // If a `Unique` solution has no associated data, omit the trailing semicolon.
167
+ // This makes blessed test output nicer to read.
168
+ Solution :: Unique ( Canonical { binders, value : ConstrainedSubst { subst, constraints } } )
169
+ if interner. constraints_data ( constraints. interned ( ) ) . is_empty ( )
170
+ && interner. substitution_data ( subst. interned ( ) ) . is_empty ( )
171
+ && interner. canonical_var_kinds_data ( binders. interned ( ) ) . is_empty ( )
172
+ => write ! ( f, "Unique" ) ,
173
+
174
+ Solution :: Unique ( constrained) => write ! ( f, "Unique; {}" , constrained. display( * interner) ) ,
175
+
168
176
Solution :: Ambig ( Guidance :: Definite ( subst) ) => write ! (
169
177
f,
170
178
"Ambiguous; definite substitution {}" ,
You can’t perform that action at this time.
0 commit comments