Open2
rustc lint
rustc 1.55.0
rust -W help
で見る.
-
absolute-paths-not-starting-with-crate
- 2018だとそもそもコンパイルできないので不要
-
box-pointers
This lint is mostly historical, and not particularly useful.
- とあるので不要そう
- (
deprecated-in-future
)The
deprecated_in_future
lint is internal to rustc and should not be used by user code. -
elided-lifetimes-in-paths
- 匿名ライフタイム使えってやつ
-
rust-2018-idioms
経由で指定する
-
explicit-outlives-requirements
- 不要なライフタイム境界に警告
-
rust-2018-idioms
経由で指定する
-
keyword-idents
- 2018だとそもそもコンパイルできないので不要
-
macro-use-extern-crate
-
#[macro_use]
に対する警告.
-
-
meta-variable-misuse
- マクロ定義で変数の誤使用に対する警告
- 不達コードだとコンパイルエラーにならないよう
- 誤使用というよりdead codeの問題のような……
-
missing-abi
- 暗黙の
extern "C"
に対する警告 - rustfmtの
force_explicit_abi
で直してくれるので不要
- 暗黙の
-
missing-copy-implementations
-
Copy
のつけ忘れに警告
-
-
missing-debug-implementations
-
Debug
のつけ忘れに警告
-
-
missing-docs
- 公開APIに対するドキュメントの欠如に警告
-
non-ascii-idents
- 非ascii文字を含んだ識別子への警告
-
noop-method-call
-
T: !Clone
のとき、<&T as Clone>::clone()
を呼ぶと何もしないらしい.そういった場合への警告 - 警告例のコードは、
clippy::clone_double_ref
(correctness)に指摘された
-
-
pointer-structural-match
- ポインタへのパターンマッチはコンパイラ依存らしい
-
future-incompatible
経由で指定
-
rust-2021-incompatible-closure-captures
- https://blog.rust-lang.org/2021/05/11/edition-2021.html#disjoint-capture-in-closures の影響
-
rust-2021-compatibility
経由で指定
-
rust-2021-incompatible-or-patterns
- https://blog.rust-lang.org/2021/05/11/edition-2021.html#or-patterns-in-macro_rules の影響
-
rust-2021-compatibility
経由で指定
-
rust-2021-prefixes-incompatible-syntax
- https://blog.rust-lang.org/2021/05/11/edition-2021.html#reserving-syntax の影響
-
rust-2021-compatibility
経由で指定
-
rust-2021-prelude-collisions
- https://blog.rust-lang.org/2021/05/11/edition-2021.html#additions-to-the-prelude の影響
-
rust-2021-compatibility
経由で指定
-
semicolon-in-expressions-from-macros
-
macro_rules!
のbodyの末尾にセミコロンがある場合に警告 -
future-incompatible
経由で指定
-
-
single-use-lifetimes
-
clippy::needless_lifetimes
(complexity) でよさそう
-
-
trivial-casts
-
&T
をas *const T
する等、不要な型変換に警告
-
-
trivial-numeric-casts
-
42_i32 as i32
のような不要な型変換に警告 -
clippy::unnecessary_cast
(complexity) でよさそう
-
-
unreachable-pub
- crate rootから到達不能な
pub
への警告
- crate rootから到達不能な
-
unsafe-code
-
unsafe
の使用に警告
-
-
unsafe-op-in-unsafe-fn
-
unsafe fn
の中でもunsafe
ブロックの使用を強いる - これがallowの状態で、
unsafe fn
の中でもunsafe
ブロックを書くと今度はunused-unsafe
に引っかかる - どこで
unsafe
を使っているのかが明確になってよい気がする
-
-
unstable-features
The
unstable_features
is deprecated and should no longer be used. -
unused-crate-dependencies
- 使われていないcrate依存に警告
-
unused-extern-crates
-
rust-2018-idioms
経由で指定
-
-
unused-import-braces
-
use test::{A};
のような波括弧に警告 - rustfmtで直るので不要
-
-
unused-lifetimes
-
clippy::extra_unused_lifetimes
(complexity) でよさそう
-
-
unused-qualifications
-
use
していて、もっと短いパスで参照できるときに警告
-
-
unused-results
- 返り値を使っていない場合に警告
-
variant-size-differences
-
enum
に[u8; 1024]
みたいなのを入れると、enum
のサイズが大きくなるのでヒープに置けって話
-