bevy_lint/lib.rs
1//! `bevy_lint` is a custom linter for the [Bevy game engine](https://bevyengine.org), similar to
2//! [Clippy](https://doc.rust-lang.org/stable/clippy).
3//!
4//! This is the primary documentation for its lints and lint groups. `bevy_lint` is not intended to
5//! be consumed as a library. You can find the documentation for individual lints and their groups
6//! in the [`lints`] module.
7//!
8//! <!--
9//! Override these links to point to the local copy of the docs.
10//! For more info on how this works, see <https://linebender.org/blog/doc-include/>.
11//! -->
12//! [**Documentation**]: crate
13//! [**All Lints**]: crate::lints
14#![doc = include_str!("../README.md")]
15// Enables linking to `rustc` crates.
16#![feature(rustc_private)]
17// Allows chaining `if let` multiple times using `&&`.
18#![feature(let_chains)]
19// Used to access the index of repeating macro input in `declare_bevy_symbols!`.
20#![feature(macro_metavar_expr)]
21// Warn on internal `rustc` lints that check for poor usage of internal compiler APIs. Note that
22// you also need to pass `-Z unstable-options` to `rustc` for this to be enabled:
23// `RUSTFLAGS="-Zunstable-options" cargo check`
24#![warn(rustc::internal)]
25#![allow(
26 rustc::usage_of_ty_tykind,
27 reason = "Many false positives without a valid replacement."
28)]
29
30// This is a list of every single `rustc` crate used within this library. If you need another, add
31// it here!
32extern crate rustc_abi;
33extern crate rustc_ast;
34extern crate rustc_data_structures;
35extern crate rustc_driver;
36extern crate rustc_errors;
37extern crate rustc_hir;
38extern crate rustc_hir_analysis;
39extern crate rustc_interface;
40extern crate rustc_lint;
41extern crate rustc_lint_defs;
42extern crate rustc_middle;
43extern crate rustc_session;
44extern crate rustc_span;
45extern crate rustc_type_ir;
46
47mod callback;
48mod config;
49mod lint;
50pub mod lints;
51mod paths;
52mod sym;
53mod utils;
54
55pub use self::callback::BevyLintCallback;