Why this fires¶
A bare name matches a known standard-library module (math, json, http, os, ...), but the module was never brought into scope with use std::<name> (or use std::*). Referencing an un-imported module by name is not the same mistake as referencing a truly undefined variable (TE100) — Zolo recognizes the name and tells you exactly which use line is missing.
let result = math.sqrt(4.0)
// ^^^^ error[TE105]: `math` requires `use std::math` (or `use std::*`)Fix it¶
Add the missing import:
use std::math
let result = math.sqrt(4.0) // okTE105 also fires on near-misses — a typo that is one edit away from a real module name:
let x = jsom.stringify(#{ a: 1 })
// ^^^^ error[TE105]: `jsom` is not a known name. Did you mean the stdlib module `json` (`use std::json`)?Fix the spelling and add the import:
use std::json
let x = json.stringify(#{ a: 1 }) // okSee also¶
TE100— undefined variable (a name with no relation to any stdlib module).- /docs/modules —
useand the standard library layout.