1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use std::fmt::{Formatter, Result};
use chalk_ir::interner::Interner;
use chalk_ir::*;
use super::{render_trait::RenderAsRust, state::WriterState};
impl<I: Interner> RenderAsRust<I> for AdtId<I> {
    fn fmt(&self, s: &WriterState<'_, I>, f: &'_ mut Formatter<'_>) -> Result {
        
        write!(
            f,
            "{}",
            s.alias_for_adt_id_name(self.0, s.db.adt_name(*self))
        )
    }
}
impl<I: Interner> RenderAsRust<I> for TraitId<I> {
    fn fmt(&self, s: &WriterState<'_, I>, f: &'_ mut Formatter<'_>) -> Result {
        
        write!(f, "{}", s.alias_for_id_name(self.0, s.db.trait_name(*self)))
    }
}
impl<I: Interner> RenderAsRust<I> for AssocTypeId<I> {
    fn fmt(&self, s: &WriterState<'_, I>, f: &'_ mut Formatter<'_>) -> Result {
        
        f.write_str(&s.db.assoc_type_name(*self))
    }
}
impl<I: Interner> RenderAsRust<I> for OpaqueTyId<I> {
    fn fmt(&self, s: &WriterState<'_, I>, f: &'_ mut Formatter<'_>) -> Result {
        
        write!(
            f,
            "{}",
            s.alias_for_id_name(self.0, s.db.opaque_type_name(*self))
        )
    }
}