Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/lower.rs')
-rw-r--r--crates/hir-ty/src/mir/lower.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs
index 99930798e8..28d26c6c8a 100644
--- a/crates/hir-ty/src/mir/lower.rs
+++ b/crates/hir-ty/src/mir/lower.rs
@@ -97,7 +97,7 @@ pub enum MirLowerError {
MutatingRvalue,
UnresolvedLabel,
UnresolvedUpvar(Place),
- UnaccessableLocal,
+ InaccessibleLocal,
// monomorphization errors:
GenericArgNotProvided(TypeOrConstParamId, Substitution),
@@ -116,7 +116,7 @@ impl DropScopeToken {
ctx.pop_drop_scope_internal(current, span)
}
- /// It is useful when we want a drop scope is syntaxically closed, but we don't want to execute any drop
+ /// It is useful when we want a drop scope is syntactically closed, but we don't want to execute any drop
/// code. Either when the control flow is diverging (so drop code doesn't reached) or when drop is handled
/// for us (for example a block that ended with a return statement. Return will drop everything, so the block shouldn't
/// do anything)
@@ -186,7 +186,7 @@ impl MirLowerError {
| MirLowerError::UnsizedTemporary(_)
| MirLowerError::IncompleteExpr
| MirLowerError::IncompletePattern
- | MirLowerError::UnaccessableLocal
+ | MirLowerError::InaccessibleLocal
| MirLowerError::TraitFunctionDefinition(_, _)
| MirLowerError::UnresolvedName(_)
| MirLowerError::RecordLiteralWithoutPath
@@ -939,7 +939,7 @@ impl<'ctx> MirLowerCtx<'ctx> {
Ok(Some(current))
}
Expr::BinaryOp { lhs, rhs, op } => {
- let op = op.ok_or(MirLowerError::IncompleteExpr)?;
+ let op: BinaryOp = op.ok_or(MirLowerError::IncompleteExpr)?;
let is_builtin = 'b: {
// Without adjust here is a hack. We assume that we know every possible adjustment
// for binary operator, and use without adjust to simplify our conditions.
@@ -1843,8 +1843,8 @@ impl<'ctx> MirLowerCtx<'ctx> {
None => {
// FIXME: It should never happens, but currently it will happen in `const_dependent_on_local` test, which
// is a hir lowering problem IMO.
- // never!("Using unaccessable local for binding is always a bug");
- Err(MirLowerError::UnaccessableLocal)
+ // never!("Using inaccessible local for binding is always a bug");
+ Err(MirLowerError::InaccessibleLocal)
}
}
}
@@ -2068,7 +2068,7 @@ pub fn mir_body_for_closure_query(
}
pub fn mir_body_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Result<Arc<MirBody>> {
- let _p = profile::span("mir_body_query").detail(|| match def {
+ let detail = match def {
DefWithBodyId::FunctionId(it) => db.function_data(it).name.display(db.upcast()).to_string(),
DefWithBodyId::StaticId(it) => db.static_data(it).name.display(db.upcast()).to_string(),
DefWithBodyId::ConstId(it) => db
@@ -2082,7 +2082,8 @@ pub fn mir_body_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Result<Arc<Mi
db.enum_variant_data(it).name.display(db.upcast()).to_string()
}
DefWithBodyId::InTypeConstId(it) => format!("in type const {it:?}"),
- });
+ };
+ let _p = tracing::span!(tracing::Level::INFO, "mir_body_query", ?detail).entered();
let body = db.body(def);
let infer = db.infer(def);
let mut result = lower_to_mir(db, def, &body, &infer, body.body_expr)?;