Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/eval.rs')
-rw-r--r--crates/hir-ty/src/mir/eval.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/crates/hir-ty/src/mir/eval.rs b/crates/hir-ty/src/mir/eval.rs
index 0d42617d18..e73b9dc27d 100644
--- a/crates/hir-ty/src/mir/eval.rs
+++ b/crates/hir-ty/src/mir/eval.rs
@@ -6,6 +6,7 @@ use base_db::CrateId;
use chalk_ir::{cast::Cast, Mutability};
use either::Either;
use hir_def::{
+ body::HygieneId,
builtin_type::BuiltinType,
data::adt::{StructFlags, VariantData},
lang_item::LangItem,
@@ -1628,6 +1629,10 @@ impl Evaluator<'_> {
}
CastKind::FnPtrToPtr => not_supported!("fn ptr to ptr cast"),
},
+ Rvalue::ThreadLocalRef(n)
+ | Rvalue::AddressOf(n)
+ | Rvalue::BinaryOp(n)
+ | Rvalue::NullaryOp(n) => match *n {},
})
}
@@ -2703,17 +2708,15 @@ impl Evaluator<'_> {
TyKind::Function(_) => {
self.exec_fn_pointer(func_data, destination, &args[1..], locals, target_bb, span)
}
- TyKind::Closure(closure, subst) => {
- return self.exec_closure(
- *closure,
- func_data,
- &Substitution::from_iter(Interner, ClosureSubst(subst).parent_subst()),
- destination,
- &args[1..],
- locals,
- span,
- );
- }
+ TyKind::Closure(closure, subst) => self.exec_closure(
+ *closure,
+ func_data,
+ &Substitution::from_iter(Interner, ClosureSubst(subst).parent_subst()),
+ destination,
+ &args[1..],
+ locals,
+ span,
+ ),
_ => {
// try to execute the manual impl of `FnTrait` for structs (nightly feature used in std)
let arg0 = func;
@@ -2846,7 +2849,8 @@ impl Evaluator<'_> {
}
let layout = self.layout_adt(id.0, subst.clone())?;
match data.variant_data.as_ref() {
- VariantData::Record(fields) | VariantData::Tuple(fields) => {
+ VariantData::Record { fields, .. }
+ | VariantData::Tuple { fields, .. } => {
let field_types = self.db.field_types(s.into());
for (field, _) in fields.iter() {
let offset = layout
@@ -2951,6 +2955,7 @@ pub fn render_const_using_debug_impl(
let Some(ValueNs::FunctionId(format_fn)) = resolver.resolve_path_in_value_ns_fully(
db.upcast(),
&hir_def::path::Path::from_known_path_with_no_generic(path![std::fmt::format]),
+ HygieneId::ROOT,
) else {
not_supported!("std::fmt::format not found");
};