mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Support evaluating inherent associated constants with generics
This commit is contained in:
parent
3303a6eff5
commit
8a3ad7c3d5
7 changed files with 22 additions and 33 deletions
|
@ -1801,7 +1801,7 @@ impl Function {
|
|||
let body = db
|
||||
.mir_body(self.id.into())
|
||||
.map_err(|e| MirEvalError::MirLowerError(self.id.into(), e))?;
|
||||
interpret_mir(db, &body, false)?;
|
||||
interpret_mir(db, &body, Substitution::empty(Interner), false)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -1947,7 +1947,7 @@ impl Const {
|
|||
}
|
||||
|
||||
pub fn render_eval(self, db: &dyn HirDatabase) -> Result<String, ConstEvalError> {
|
||||
let c = db.const_eval(self.id)?;
|
||||
let c = db.const_eval(self.id, Substitution::empty(Interner))?;
|
||||
let r = format!("{}", HexifiedConst(c).display(db));
|
||||
// We want to see things like `<utf8-error>` and `<layout-error>` as they are probably bug in our
|
||||
// implementation, but there is no need to show things like `<enum-not-supported>` or `<ref-not-supported>` to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue