Pretty-print uninhabited const values more explicitly.
This commit is contained in:
parent
47ab5f7ce2
commit
e291234f59
1 changed files with 9 additions and 2 deletions
|
@ -1218,8 +1218,15 @@ pub trait PrettyPrinter<'tcx>:
|
||||||
}
|
}
|
||||||
p!(")");
|
p!(")");
|
||||||
}
|
}
|
||||||
ty::Adt(def, substs) if def.variants.is_empty() => {
|
ty::Adt(def, _) if def.variants.is_empty() => {
|
||||||
p!(print_value_path(def.did, substs));
|
self = self.typed_value(
|
||||||
|
|mut this| {
|
||||||
|
write!(this, "unreachable()")?;
|
||||||
|
Ok(this)
|
||||||
|
},
|
||||||
|
|this| this.print_type(ty),
|
||||||
|
": ",
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
ty::Adt(def, substs) => {
|
ty::Adt(def, substs) => {
|
||||||
let variant_id =
|
let variant_id =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue