Home / Docs / Diagnostics
U7012: A dependency the root may not use as written
Release v0.4.0
A package of edition 0.4 uses a dependency only on terms its root states (ADR 0122, spec/30). U7012 reports, at the root's need, a dependency the root may not use as written: a package from a local path whose name a registry may hold, without accept name under the need, so a local package never silently takes the place of a published one; and a dependency of a later edition than the package. The repair is to accept the name, after checking that the path is the package meant, or to use an earlier version.
The repair at a glance
ita.una
ita demo
version 0.1.0
edition 0.4
needs
util from path "deps/util"
+ accept namesrc/demo.una
module demo
- pub one() -> Int = 1
+ import util.text (shout)
+
+ pub greet() -> Text = shout("hello")Failing example
ita.una
ita demo
version 0.1.0
edition 0.4
needs
util from path "deps/util"ita.lock
lock 1
solver
encoding "una-smt-1"
name "z3"
version "5.1.0"
logic "QF_UFLIA"
steps 5000000
seed 0
package util 0.1.0
from path "deps/util"
digest "sha256:0000000000000000000000000000000000000000000000000000000000000000"deps/util/ita.una
ita util
version 0.1.0
edition 0.4deps/util/src/text.una
module text
pub shout(word: Text) -> Text = wordsrc/demo.una
module demo
pub one() -> Int = 1Fixed example
ita.una
ita demo
version 0.1.0
edition 0.4
needs
util from path "deps/util"
accept nameita.lock
lock 1
solver
encoding "una-smt-1"
name "z3"
version "5.1.0"
logic "QF_UFLIA"
steps 5000000
seed 0
package util 0.1.0
from path "deps/util"
digest "sha256:0000000000000000000000000000000000000000000000000000000000000000"deps/util/ita.una
ita util
version 0.1.0
edition 0.4deps/util/src/text.una
module text
pub shout(word: Text) -> Text = wordsrc/demo.una
module demo
import util.text (shout)
pub greet() -> Text = shout("hello")