Home / Docs / Configure a package
una migrate
What it does
una migrate moves a package from una.toml and verification.lock, of any edition from 0.1, to ita.una and ita.lock of edition 0.4. Every table becomes its section, grants become their lines, and comments are carried above the line they precede. It then checks the package in edition 0.4, and prints every diagnostic the change of edition causes, with its repairs. It applies none of them: una fix does that.
Edition 0.4 is written only in ita.una. A una.toml that names it is U7002, with una migrate as its repair:
una.toml
[package]
name = "shop"
version = "0.1.0"
edition = "0.4"src/shop.una
-- fails with U7002
module shop
pub one() -> Int = 1After una migrate, the same package is:
ita.una
ita shop
version 0.1.0
edition 0.4src/shop.una
module shop
pub one() -> Int = 1Forms
text
una migrate [path] [--dry-run] [--name <name>] [--json]--dry-runprints the two files and the diagnostics, and writes nothing.--namegives the package a name when itsuna.tomlname is not one: a-becomes_on its own.--jsonprints oneuna.migrate/1document.
Examples
Terminal
$ una migrate
wrote ita.una, ita.lock; removed una.toml, verification.lock
name: events-example -> events_example
edition 0.2 -> 0.4: 1 diagnosticuna.toml |
ita.una |
|---|---|
[package] name, version, edition |
ita <name>, version, edition 0.4 |
[labels] categories |
labels, one per line |
[trusted] modules |
trusted |
[escape_budget] checked_per_module |
escapes, checked per module <n> |
[boundaries], [contracts] |
boundaries, contracts |
[run] entry, grants |
run, entry, grants, one line per grant |
verification.lock |
the solver section of ita.lock |
Edge cases
- Edition-gated. A package that already has
ita.unais a usage error. - Refused. An invalid
una.tomlorverification.lockis refused, and nothing is written. - Comments. A comment of
una.tomlthat precedes no key or table is listed in the output, with its line. - The new edition's words. A function named
within, a word edition0.4reserves, is reported, not renamed. exampletests. The test declaration is writtentestfrom edition0.3(ADR 0105). A package of edition0.1or0.2keeps itsexample "..."declarations throughuna migrate, and each is reported as U0101 in edition0.4, at its text literal, with no repair, souna fixdoes not change it. Move such a package to edition0.3first: setedition = "0.3"in itsuna.toml, rununa fix, which rewrites eachexampletotest(U0103), then rununa migrate. Or writetestby hand.
Diagnostics
- U7002: a
una.tomlnaming edition0.4.
Edition
From editions 0.1 to 0.3, and a una.toml that names 0.4, to edition 0.4.
Normative source
- spec/30 §8:
una migrate; spec/13 §7: the settings ofuna.toml.