Home / Docs / Diagnostics

U7005: Trusted module not declared in both header and una.toml

Release v0.4.0

A module is declared trusted in its header or in its package's settings, una.toml or from edition 0.4 ita.una, but not in both. U7005 also reports a listed module that the package does not have.

Why Una rejects it

A trusted module may declare information-flow policies (spec/07 §6), so trust is declared twice: the module's header says trusted module, and una.toml lists the module under [trusted] modules, or from edition 0.4 the trusted section of ita.una does. U7005 reports a module declared in only one of the two places, and a listed module that the package does not have.

A file checked on its own has no una.toml and no ita.una, so a trusted module header there is always U7005.

How to fix it

The repair at a glance

src/keys.unadiff
- trusted module keys
+ module keys

  pub pepper() -> Int = 7

Failing example

src/keys.unauna
trusted module keys

pub pepper() -> Int = 7

Fixed example

src/keys.unauna
module keys

pub pepper() -> Int = 7