Skip to content

X0022 deny-sources

Rule: Every crate comes from a registry or git source deny.toml allows.

Code X0022 (stable, never reused)
Id deny-sources
Category deny
Source cargo-deny (run as an executable)
Fix by hand
Needs cargo-deny installed

Level per tier

Tier Level Reason
small off
small-workspace off
medium off
big deny crates come only from the registries and git hosts deny.toml trusts
ai off
embedded off
ui off
egui off
units-strict off
units-paranoid off

Why

Crates should come from the registries and git hosts the project trusts. deny.toml's [sources] lists them; a crate from anywhere else is reported.

How to fix

Take the crate from an allowed source, or allow its registry or git organisation in [sources].

Configure

[lints.deny-sources]
level = "deny"
reason = "why this project wants it at this level"

Allow one finding in the code with // spirit-level: allow(deny-sources) <reason> (waivers); the code works there too, as in [lints.X0022].