diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/chalk-solve-0.87.0/src/display/render_trait.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/chalk-solve-0.87.0/src/display/render_trait.rs')
-rw-r--r-- | vendor/chalk-solve-0.87.0/src/display/render_trait.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/vendor/chalk-solve-0.87.0/src/display/render_trait.rs b/vendor/chalk-solve-0.87.0/src/display/render_trait.rs deleted file mode 100644 index a565f076c..000000000 --- a/vendor/chalk-solve-0.87.0/src/display/render_trait.rs +++ /dev/null @@ -1,30 +0,0 @@ -//! `RenderAsRust` trait and related utils. -use std::fmt::{Display, Formatter, Result}; - -use chalk_ir::interner::Interner; - -use super::state::InternalWriterState; - -/// Displays `RenderAsRust` data. -/// -/// This is a utility struct for making `RenderAsRust` nice to use with rust format macros. -pub(in crate::display) struct DisplayRenderAsRust<'a, I: Interner, T> { - s: &'a InternalWriterState<'a, I>, - rar: &'a T, -} - -impl<I: Interner, T: RenderAsRust<I>> Display for DisplayRenderAsRust<'_, I, T> { - fn fmt(&self, f: &mut Formatter<'_>) -> Result { - self.rar.fmt(self.s, f) - } -} - -pub(in crate::display) trait RenderAsRust<I: Interner> { - fn fmt(&self, s: &InternalWriterState<'_, I>, f: &mut Formatter<'_>) -> Result; - fn display<'a>(&'a self, s: &'a InternalWriterState<'a, I>) -> DisplayRenderAsRust<'a, I, Self> - where - Self: Sized, - { - DisplayRenderAsRust { s, rar: self } - } -} |