Example Dylint libraries

August 28, 2026 ยท View on GitHub

The example libraries are separated into the following three categories:

  • general - significant concerns; may produce false positives
  • supplementary - lesser concerns, but with a low false positive rate
  • restriction - lesser or stylistic concerns; may produce false positives (similar to Clippy's "restriction" category)
  • experimental - not ready for primetime yet (similar to Clippy's "nursery" category)
  • testing - used only for testing purposes

General

ExampleDescription/check
abs_home_pathString literals that are absolute paths into the user's home directory
await_holding_span_guardSpan guards held while calling await inside an async function
basic_dead_storeA lint to find simple instances of dead stores in arrays
crate_wide_allow#![allow(...)] used at the crate level
incorrect_matches_operationIncorrect operators used with matches! macros
non_local_effect_before_unhandled_errorUnhandled errors from functions with non-local effects before error return
non_thread_safe_call_in_testNon-thread-safe function calls in tests
wrong_serialize_struct_argCalls to serialization methods with incorrect len arguments

Supplementary

ExampleDescription/check
commented_out_codeCode that has been commented out
concatenable_format_argsformat!(...) invocations where concat!(...) could be used instead
escaping_doc_linkDoc comment links that escape their packages
inconsistent_struct_patternStruct patterns whose fields do not match their declared order
local_ref_cellRefCell local variables
nonexistent_path_in_commentLint for nonexistent paths in comments
redundant_referenceReference fields used only to read one copyable subfield
unnamed_constantUnnamed constants, aka magic numbers
unnecessary_borrow_mutCalls to RefCell::borrow_mut that could be RefCell::borrow
unnecessary_conversion_for_traitUnnecessary trait-behavior-preserving calls

Restriction

ExampleDescription/check
assert_eq_arg_misorderingMisordered assert_eq! and assert_ne! arguments
collapsible_unwrapAn unwrap that could be combined with an expect or unwrap using and_then
const_path_joinJoining of constant path components
env_literalEnvironment variables referred to with string literals
inconsistent_qualificationInconsistent qualification of module items
misleading_variable_nameVariables whose names suggest they have types other than the ones they have
non_topologically_sorted_functionsA lint to check the function order
question_mark_in_expressionThe ? operator in expressions
ref_aware_redundant_closure_for_method_callsA ref-aware fork of redundant_closure_for_method_calls
register_lints_warnCalls to rustc_errors::DiagCtxtHandle::warn from within a register_lints function
suboptimal_patternPatterns that could perform additional destructuring
try_io_resultThe ? operator applied to std::io::Result

Experimental

ExampleDescription/check
derive_opportunityTraits that could be derived
missing_doc_comment_llmA lint that suggests doc comments using an LLM

Testing

ExampleDescription/check
clippyAll of the Clippy lints as a Dylint library
stragglerA lint that uses an old toolchain for testing purposes

Notes

  1. Each example is in its own workspace so that it can have its own rust-toolchain.
  2. Each example is configured to use the installed copy of dylint-link. To use the copy within this repository, change the example's .cargo/config.toml file as follows:
    [target.x86_64-unknown-linux-gnu]
    linker = "../../../target/debug/dylint-link"