mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
MIR episode 5
This commit is contained in:
parent
9b3387454d
commit
cbcafd3539
36 changed files with 1532 additions and 362 deletions
|
@ -420,13 +420,8 @@ impl HirDisplay for Const {
|
|||
ConstValue::Concrete(c) => match &c.interned {
|
||||
ConstScalar::Bytes(b, m) => render_const_scalar(f, &b, m, &data.ty),
|
||||
ConstScalar::UnevaluatedConst(c, parameters) => {
|
||||
let const_data = f.db.const_data(*c);
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
const_data.name.as_ref().and_then(|x| x.as_str()).unwrap_or("_")
|
||||
)?;
|
||||
hir_fmt_generics(f, parameters, Some((*c).into()))?;
|
||||
write!(f, "{}", c.name(f.db.upcast()))?;
|
||||
hir_fmt_generics(f, parameters, c.generic_def(f.db.upcast()))?;
|
||||
Ok(())
|
||||
}
|
||||
ConstScalar::Unknown => f.write_char('_'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue