Home / Learn / 19 Editions
19.10 Recap and reference
Page 11 of 11
19.10.1 For agents
A construct of a later edition usually gives U0101 or U0103 at the construct, a table of a later edition U7002 at una.toml, edition = "0.4" in una.toml U7002 with una migrate as its repair, and a later prelude function or type rule a type error, such as U1001, U2001 or U2002. To move a package, change only edition, run una --json check ., apply una fix ., and repair the rest by hand; to move it to 0.4, run una migrate . instead of editing the line, then the same loop. Never edit ita.lock by hand. Never apply a U0103 rename to edit, take or together used as a keyword: change the edition instead. A U0101 at a word the new edition made a keyword needs a rename by hand. In edition 0.3, the test declaration is test; an example there is U0103, which una fix . rewrites. The compact rule: an edition is a line of the manifest, una.toml or, from 0.4, ita.una; a later edition adds constructs and, with few exceptions, tightens rules.
19.10.2 Recap
[package] editionnames a package's edition, and is required. A single file has edition0.1.- Upgrading
unakeeps what each stable edition accepts and rejects, except to fix a soundness or security error. - Editions
0.1to0.4are cumulative: each adds constructs, keywords and rules, and removes no construct of the one before. 0.2adds loops,let edit,editandtake,together, maps, JSON and more, makesolda keyword, and reservesweak.0.3is a preview: conditions on operations, locked contracts, boundaries, narrowed rebindings, units, refined type arguments, no dead failure handling, and tests writtentest. It may get stricter in a later release.- To move a package: change the edition,
una check .,una fix ., repair the rest,una test ., and compare the output. 0.4is a preview whose package is described byita.unaand pinned byita.lock:una migratewrites both, rewrites the modules in its canonical form, and prints what the new edition reads differently. A later release may change it, never in silence.- Never let
una fixrename a keyword of a later edition; change the edition instead.
19.10.3 Reference
- Editions: editions, moving from 0.1 to 0.2,
[package] edition,[boundaries] - Construct pages:
let edit,for,together,uses,if error,attempt, constraints on generics - Command line:
una check,una fix,una migrate - Diagnostics: U0101, U0103, U1002, U2001, U2002, U2028, U3023, U3025, U3026, U5001, U7002
- Specification: project files and editions, packages and
una migrate, lexical structure, reserved words, types, memory model, capabilities and effects, errors
Next:Documentation