mod pretty;
pub use self::pretty::*;
+pub mod obsolete;
+
pub trait Print<'gcx, 'tcx, P> {
type Output;
type Error;
type Region;
type Type;
type DynExistential;
+ type Const;
fn tcx(&'a self) -> TyCtxt<'a, 'gcx, 'tcx>;
predicates: &'tcx ty::List<ty::ExistentialPredicate<'tcx>>,
) -> Result<Self::DynExistential, Self::Error>;
+ fn print_const(
+ self,
+ ct: &'tcx ty::Const<'tcx>,
+ ) -> Result<Self::Const, Self::Error>;
+
fn path_crate(
self,
cnum: CrateNum,
cx.print_dyn_existential(self)
}
}
+
+impl<'gcx: 'tcx, 'tcx, P: Printer<'gcx, 'tcx>> Print<'gcx, 'tcx, P> for &'tcx ty::Const<'tcx> {
+ type Output = P::Const;
+ type Error = P::Error;
+ fn print(&self, cx: P) -> Result<Self::Output, Self::Error> {
+ cx.print_const(self)
+ }
+}