Home / Docs / Diagnostics

U7002: Invalid una.toml

Release v0.4.0

una.toml describes the package (spec/13 §7, ADR 0021): a required [package] table with name, version and edition, one of "0.1", "0.2" and "0.3", and the optional tables [labels], [trusted], [escape_budget] and [run]; edition 0.3 adds the tables [contracts] and [boundaries], profile in [package] and max_memory in [run]. From edition 0.4 the package is described by ita.una, and an edition of 0.4 or later in una.toml is U7002. U7002 reports a TOML syntax error, an unknown table or key, a missing required key, and a value of the wrong type or out of range, such as a [run] entry that is not a module of the package.

The repair at a glance

una.tomldiff
  [package]
  name = "demo"
  version = "0.1.0"
  edition = "0.1"
- license = "MIT"

Failing example

una.tomltoml
[package]
name = "demo"
version = "0.1.0"
edition = "0.1"
license = "MIT"
src/demo.unauna
module demo

pub one() -> Int = 1

Fixed example

una.tomltoml
[package]
name = "demo"
version = "0.1.0"
edition = "0.1"
src/demo.unauna
module demo

pub one() -> Int = 1