Home Explore Blog CI



rustc

1st chunk of `src/crates-io.md`
82f213e21c16e234c3f3214e0d117d7b61e9145878b36102000000010000031c
# crates.io dependencies

The Rust compiler supports building with some dependencies from `crates.io`.
Examples are `log` and `env_logger`.

In general,
you should avoid adding dependencies to the compiler for several reasons:

- The dependency may not be of high quality or well-maintained.
- The dependency may not be using a compatible license.
- The dependency may have transitive dependencies that have one of the above
  problems.

<!-- date-check: Feb 2023 -->
Note that there is no official policy for vetting new dependencies to the compiler.
Decisions are made on a case-by-case basis, during code review.

## Permitted dependencies

The `tidy` tool has [a list of crates that are allowed]. To add a
dependency that is not already in the compiler, you will need to add it to the list.


Title: crates.io Dependencies in the Rust Compiler
Summary
The Rust compiler can use dependencies from crates.io, but adding new dependencies should be avoided due to potential issues with quality, maintenance, and licensing. The `tidy` tool maintains a list of permitted crates, and new dependencies require addition to this list and approval during code review.