await-outside-of-async

This diagnostic is triggered if the await keyword is used outside of an async function or block

break-outside-of-loop

This diagnostic is triggered if the break keyword is used outside of a loop.

cast-to-unsized

Source: invalid_cast.rs

This diagnostic is triggered when casting to an unsized type

expected-function

This diagnostic is triggered if a call is made on something that is not callable.

generic-args-prohibited

This diagnostic is shown when generic arguments are provided for a type that does not accept generic arguments.

inactive-code

This diagnostic is shown for code with inactive #[cfg] attributes.

incoherent-impl

This diagnostic is triggered if the targe type of an impl is from a foreign crate.

incorrect-ident-case

This diagnostic is triggered if an item name doesn’t follow Rust naming convention.

invalid-cast

Source: invalid_cast.rs

This diagnostic is triggered if the code contains an illegal cast

invalid-derive-target

This diagnostic is shown when the derive attribute is used on an item other than a struct, enum or union.

macro-def-error

Source: macro_error.rs

This diagnostic is shown for macro expansion errors.

macro-error

Source: macro_error.rs

This diagnostic is shown for macro expansion errors.

malformed-derive

This diagnostic is shown when the derive attribute has invalid input.

mismatched-arg-count

This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.

mismatched-tuple-struct-pat-arg-count

This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.

missing-fields

This diagnostic is triggered if record lacks some fields that exist in the corresponding structure.

Example:

1
2
3
struct A { a: u8, b: u8 }

let a = A { a: 10 };

missing-match-arm

This diagnostic is triggered if match block is missing one or more match arms.

missing-unsafe

This diagnostic is triggered if an operation marked as unsafe is used outside of an unsafe function or block.

moved-out-of-ref

This diagnostic is triggered on moving non copy things out of references.

need-mut

This diagnostic is triggered on mutating an immutable variable.

no-such-field

This diagnostic is triggered if created structure does not have field provided in record.

non-exhaustive-let

This diagnostic is triggered if a let statement without an else branch has a non-exhaustive pattern.

private-assoc-item

This diagnostic is triggered if the referenced associated item is not visible from the current module.

private-field

This diagnostic is triggered if the accessed field is not visible from the current module.

proc-macro-disabled

Source: macro_error.rs

This diagnostic is shown for proc macros that has been specifically disabled via rust-analyzer.procMacro.ignored.

proc-macros-disabled

Source: macro_error.rs

This diagnostic is shown for proc macros where proc macros have been disabled.

remove-trailing-return

This diagnostic is triggered when there is a redundant return at the end of a function or closure.

remove-unnecessary-else

This diagnostic is triggered when there is an else block for an if expression whose then branch diverges (e.g. ends with a return, continue, break e.t.c).

replace-filter-map-next-with-find-map

This diagnostic is triggered when .filter_map(..).next() is used, rather than the more concise .find_map(..).

trait-impl-incorrect-safety

Diagnoses incorrect safety annotations of trait impls.

trait-impl-missing-assoc_item

Diagnoses missing trait items in a trait impl.

trait-impl-orphan

Only traits defined in the current crate can be implemented for arbitrary types

trait-impl-redundant-assoc_item

Diagnoses redundant trait items in a trait impl.

type-mismatch

This diagnostic is triggered when the type of an expression or pattern does not match the expected type.

typed-hole

Source: typed_hole.rs

This diagnostic is triggered when an underscore expression is used in an invalid position.

undeclared-label

unimplemented-builtin-macro

This diagnostic is shown for builtin macros which are not yet implemented by rust-analyzer

unlinked-file

This diagnostic is shown for files that are not included in any crate, or files that are part of crates rust-analyzer failed to discover. The file will not have IDE features available.

unnecessary-braces

Diagnostic for unnecessary braces in use items.

unreachable-label

unresolved-assoc-item

This diagnostic is triggered if the referenced associated item does not exist.

unresolved-extern-crate

This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate.

unresolved-field

This diagnostic is triggered if a field does not exist on a given type.

unresolved-ident

This diagnostic is triggered if an expr-position ident is invalid.

unresolved-import

This diagnostic is triggered if rust-analyzer is unable to resolve a path in a use declaration.

unresolved-macro-call

This diagnostic is triggered if rust-analyzer is unable to resolve the path to a macro in a macro invocation.

unresolved-method

This diagnostic is triggered if a method does not exist on a given type.

unresolved-module

This diagnostic is triggered if rust-analyzer is unable to discover referred module.

unused-mut

This diagnostic is triggered when a mutable variable isn’t actually mutated.

unused-variables

This diagnostic is triggered when a local variable is not used.