# Diagnostics

While most errors and warnings provided by rust-analyzer come from the
`cargo check` integration, there’s a growing number of diagnostics
implemented using rust-analyzer’s own analysis. Some of these
diagnostics don’t respect `#[allow]` or `#[deny]` attributes yet, but
can be turned off using the `rust-analyzer.diagnostics.enable`,
`rust-analyzer.diagnostics.experimental.enable` or
`rust-analyzer.diagnostics.disabled` settings.

## Clippy

To run `cargo clippy` instead of `cargo check`, you can set
`"rust-analyzer.check.command": "clippy"`.


#### array-pattern-without-fixed-length

Source:  [array_pattern_without_fixed_length.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/array_pattern_without_fixed_length.rs#L3) 


This diagnostic is triggered when a rest array pattern is matched against an
array with a non-constant length.




#### attribute-expansion-disabled

Source:  [macro_error.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L7) 


This diagnostic is shown for attribute proc macros when attribute expansions have been disabled.




#### await-outside-of-async

Source:  [await_outside_of_async.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/await_outside_of_async.rs#L3) 


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




#### bad-rtn

Source:  [bad_rtn.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/bad_rtn.rs#L5) 


This diagnostic is shown when a RTN (Return Type Notation, `Type::method(..): Send`) is written in an improper place.




#### break-outside-of-loop

Source:  [break_outside_of_loop.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/break_outside_of_loop.rs#L3) 


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




#### cannot-be-dereferenced

Source:  [cannot_be_dereferenced.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/cannot_be_dereferenced.rs#L5) 


This diagnostic is triggered if the operand of a dereference expression
cannot be dereferenced.




#### cannot-implicitly-deref-trait-object

Source:  [cannot_implicitly_deref_trait_object.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/cannot_implicitly_deref_trait_object.rs#L5) 


This diagnostic is triggered when a pointer to a trait object is implicitly
dereferenced by a pattern.




#### cannot-index-into

Source:  [cannot_index_into.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/cannot_index_into.rs#L5) 


This diagnostic is triggered if indexing is used on a type that cannot be
indexed.




#### cast-to-unsized

Source:  [invalid_cast.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_cast.rs#L113) 


This diagnostic is triggered when casting to an unsized type




#### duplicate-field

Source:  [duplicate_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/duplicate_field.rs#L3) 


This diagnostic is triggered when a record expression or pattern specifies
the same field more than once.




#### elided-lifetimes-in-path

Source:  [elided_lifetimes_in_path.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/elided_lifetimes_in_path.rs#L3) 


This diagnostic is triggered when lifetimes are elided in paths. It is a lint only for some cases,
and a hard error for others.




#### expected-array-or-slice-pat

Source:  [expected_array_or_slice_pat.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/expected_array_or_slice_pat.rs#L5) 


This diagnostic is triggered when an array or slice pattern is matched
against a type that is neither an array nor a slice.




#### expected-function

Source:  [expected_function.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/expected_function.rs#L5) 


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




#### explicit-drop-method-use

Source:  [explicit_drop_method_use.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/explicit_drop_method_use.rs#L14) 


This diagnostic is triggered when the `Drop::drop` method is called (or named) explicitly.




#### fru-in-destructuring-assignment

Source:  [fru_in_destructuring_assignment.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/fru_in_destructuring_assignment.rs#L3) 


This diagnostic is triggered when a destructuring assignment contains functional record update




#### functional-record-update-on-non-struct

Source:  [functional_record_update_on_non_struct.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/functional_record_update_on_non_struct.rs#L3) 


This diagnostic is triggered when functional record update syntax is used on
something other than a struct.




#### generic-args-prohibited

Source:  [generic_args_prohibited.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/generic_args_prohibited.rs#L10) 


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




#### generic-default-refers-to-self

Source:  [generic_default_refers_to_self.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/generic_default_refers_to_self.rs#L3) 


This diagnostic is shown when a generic default refers to `Self`




#### inactive-code

Source:  [inactive_code.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/inactive_code.rs#L6) 


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




#### incoherent-impl

Source:  [incoherent_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/incoherent_impl.rs#L6) 


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




#### incorrect-generics-len

Source:  [incorrect_generics_len.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs#L4) 


This diagnostic is triggered if the number of generic arguments does not match their declaration.




#### incorrect-generics-order

Source:  [incorrect_generics_order.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/incorrect_generics_order.rs#L5) 


This diagnostic is triggered the order of provided generic arguments does not match their declaration.




#### incorrect-ident-case

Source:  [incorrect_case.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/incorrect_case.rs#L13) 


This diagnostic is triggered if an item name doesn't follow [Rust naming convention](https://doc.rust-lang.org/1.0.0/style/style/naming/README.html).




#### infer-vars-not-allowed

Source:  [infer_vars_not_allowed.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/infer_vars_not_allowed.rs#L3) 


This diagnostic is triggered when `_` is used where type
inference is not allowed.




#### invalid-cast

Source:  [invalid_cast.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_cast.rs#L18) 


This diagnostic is triggered if the code contains an illegal cast




#### invalid-derive-target

Source:  [invalid_derive_target.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_derive_target.rs#L3) 


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




#### invalid-lhs-of-assignment

Source:  [invalid_lhs_of_assignment.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_lhs_of_assignment.rs#L3) 


This diagnostic is triggered if the left-hand side of an assignment can't be assigned to.




#### invalid-range-pat-type

Source:  [invalid_range_pat_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_range_pat_type.rs#L3) 


This diagnostic is triggered when a range pattern is used with a type that
is neither `char` nor numeric.




#### macro-def-error

Source:  [macro_error.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L25) 


This diagnostic is shown for macro expansion errors.




#### macro-error

Source:  [macro_error.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L3) 


This diagnostic is shown for macro expansion errors.




#### malformed-derive

Source:  [malformed_derive.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/malformed_derive.rs#L3) 


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




#### method-call-illegal-sized-bound

Source:  [method_call_illegal_sized_bound.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/method_call_illegal_sized_bound.rs#L3) 


This diagnostic is triggered when a method is called on a trait-object
receiver but the method's predicates require `Self: Sized`, which the
trait object cannot satisfy.




#### mismatched-arg-count

Source:  [mismatched_arg_count.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L32) 


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




#### mismatched-array-pat-len

Source:  [mismatched_array_pat_len.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_array_pat_len.rs#L3) 


This diagnostic is triggered when an array pattern's element count does not
match the array's declared length.




#### mismatched-tuple-struct-pat-arg-count

Source:  [mismatched_arg_count.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L11) 


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




#### missing-fields

Source:  [missing_fields.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_fields.rs#L24) 


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

Example:

```rust
struct A { a: u8, b: u8 }

let a = A { a: 10 };
```




#### missing-lifetime

Source:  [missing_lifetime.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_lifetime.rs#L3) 


This diagnostic is triggered when a lifetime argument is missing.




#### missing-match-arm

Source:  [missing_match_arms.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_match_arms.rs#L3) 


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




#### missing-unsafe

Source:  [missing_unsafe.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/missing_unsafe.rs#L9) 


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




#### moved-out-of-ref

Source:  [moved_out_of_ref.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/moved_out_of_ref.rs#L4) 


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




#### mut-ref-in-imm-ref-pat

Source:  [mut_ref_in_imm_ref_pat.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mut_ref_in_imm_ref_pat.rs#L3) 


This diagnostic is triggered when a binding tries to mutably borrow through
an `&` pattern.




#### mutable-ref

Source:  [mutable_ref.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutable_ref.rs#L3) 


This diagnostic is triggered when binding is taken that is both mutable and by-reference.




#### need-mut

Source:  [mutability_errors.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L7) 


This diagnostic is triggered on mutating an immutable variable.




#### no-such-field

Source:  [no_such_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/no_such_field.rs#L15) 


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




#### non-exhaustive-let

Source:  [non_exhaustive_let.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/non_exhaustive_let.rs#L10) 


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




#### non-exhaustive-record-expr

Source:  [non_exhaustive_record_expr.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/non_exhaustive_record_expr.rs#L3) 


This diagnostic is triggered if a struct expression constructs a `#[non_exhaustive]`
struct from another crate.




#### non-exhaustive-record-pat

Source:  [non_exhaustive_record_pat.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/non_exhaustive_record_pat.rs#L3) 


This diagnostic is triggered if a record pattern destructures a `#[non_exhaustive]`
struct or enum variant from another crate without `..`.




#### parenthesized-generic-args-without-fn-trait

Source:  [parenthesized_generic_args_without_fn_trait.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/parenthesized_generic_args_without_fn_trait.rs#L3) 


This diagnostic is shown when a `Fn`-trait-style generic parameters (`Trait(A, B) -> C`)
was used on non-`Fn` trait/type.




#### pattern-arg-in-extern-fn

Source:  [pattern_arg_in_extern_fn.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/pattern_arg_in_extern_fn.rs#L3) 


This diagnostic is triggered if a pattern was declared as an argument in a foreign function declaration.




#### private-assoc-item

Source:  [private_assoc_item.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/private_assoc_item.rs#L3) 


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




#### private-field

Source:  [private_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/private_field.rs#L10) 


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




#### proc-macro-disabled

Source:  [macro_error.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L11) 


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




#### remove-trailing-return

Source:  [remove_trailing_return.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs#L8) 


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




#### remove-unnecessary-else

Source:  [remove_unnecessary_else.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs#L17) 


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

Source:  [replace_filter_map_next_with_find_map.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs#L11) 


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




#### trait-impl-incorrect-safety

Source:  [trait_impl_incorrect_safety.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_incorrect_safety.rs#L6) 


Diagnoses incorrect safety annotations of trait impls.




#### trait-impl-missing-assoc_item

Source:  [trait_impl_missing_assoc_item.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs#L7) 


Diagnoses missing trait items in a trait impl.




#### trait-impl-orphan

Source:  [trait_impl_orphan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_orphan.rs#L5) 


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




#### trait-impl-redundant-assoc_item

Source:  [trait_impl_redundant_assoc_item.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs#L15) 


Diagnoses redundant trait items in a trait impl.




#### type-mismatch

Source:  [type_mismatch.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_mismatch.rs#L18) 


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




#### type-must-be-known

Source:  [type_must_be_known.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_must_be_known.rs#L8) 


This diagnostic is triggered when rust-analyzer cannot infer some type.




#### typed-hole

Source:  [typed_hole.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/typed_hole.rs#L19) 


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




#### undeclared-label

Source:  [undeclared_label.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/undeclared_label.rs#L3) 






#### unimplemented-builtin-macro

Source:  [unimplemented_builtin_macro.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unimplemented_builtin_macro.rs#L3) 


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




#### unimplemented-trait

Source:  [unimplemented_trait.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unimplemented_trait.rs#L5) 


This diagnostic is triggered when rust-analyzer cannot infer some type.




#### union-expr-must-have-exactly-one-field

Source:  [union_expr_must_have_exactly_one_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/union_expr_must_have_exactly_one_field.rs#L3) 


A union expression does not have exactly one field.




#### union-pat-has-rest

Source:  [union_pat_has_rest.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/union_pat_has_rest.rs#L3) 


A union pattern uses `..`.




#### union-pat-must-have-exactly-one-field

Source:  [union_pat_must_have_exactly_one_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/union_pat_must_have_exactly_one_field.rs#L3) 


A union pattern does not have exactly one field.




#### unlinked-file

Source:  [unlinked_file.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unlinked_file.rs#L18) 


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

Source:  [useless_braces.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/useless_braces.rs#L10) 


Diagnostic for unnecessary braces in `use` items.




#### unreachable-label

Source:  [unreachable_label.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unreachable_label.rs#L3) 






#### unresolved-assoc-item

Source:  [unresolved_assoc_item.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_assoc_item.rs#L3) 


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




#### unresolved-extern-crate

Source:  [unresolved_extern_crate.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_extern_crate.rs#L3) 


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




#### unresolved-field

Source:  [unresolved_field.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_field.rs#L21) 


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




#### unresolved-ident

Source:  [unresolved_ident.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_ident.rs#L3) 


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




#### unresolved-import

Source:  [unresolved_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_import.rs#L3) 


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




#### unresolved-macro-call

Source:  [unresolved_macro_call.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs#L3) 


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




#### unresolved-method

Source:  [unresolved_method.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_method.rs#L16) 


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




#### unresolved-module

Source:  [unresolved_module.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_module.rs#L7) 


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




#### unused-must-use

Source:  [unused_must_use.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unused_must_use.rs#L3) 


This diagnostic is triggered when a value with the `#[must_use]` attribute
is dropped without being used.




#### unused-mut

Source:  [mutability_errors.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L62) 


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




#### unused-variables

Source:  [unused_variables.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unused_variables.rs#L13) 


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




#### yield-outside-of-coroutine

Source:  [yield_outside_coroutine.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/yield_outside_coroutine.rs#L3) 


This diagnostic is triggered if the `yield` keyword is used outside of a coroutine.


