We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Environment.hasUnsafe
1 parent 19e1fe5 commit dffaa93Copy full SHA for dffaa93
src/Lean/Environment.lean
@@ -2503,6 +2503,10 @@ unsafe def evalConstCheck (α) (env : Environment) (opts : Options) (typeName :
2503
| _ => throwUnexpectedType typeName constName
2504
2505
def hasUnsafe (env : Environment) (e : Expr) : Bool :=
2506
+ -- This line should not affect the result value but it avoids potential blocking in `isUnsafe` as
2507
+ -- there is a fast path for theorems, so we want to make sure we do not perceive them merely as
2508
+ -- axioms (for imported theorems this does not matter as there is nothing to block on).
2509
+ let env := env.setExporting false
2510
let c? := e.find? fun e => match e with
2511
| Expr.const c _ =>
2512
match env.findAsync? c with
0 commit comments