├── .cargo └── config.toml ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── blank_issue.yml │ ├── bug_report.yml │ ├── config.yml │ ├── false_negative.yml │ ├── false_positive.yml │ ├── ice.yml │ └── new_lint.yml ├── PULL_REQUEST_TEMPLATE.md ├── deploy.sh ├── driver.sh └── workflows │ ├── clippy_changelog.yml │ ├── clippy_dev.yml │ ├── clippy_mq.yml │ ├── clippy_pr.yml │ ├── deploy.yml │ ├── lintcheck.yml │ └── remark.yml ├── .gitignore ├── .remarkrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYRIGHT ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── askama.toml ├── book ├── README.md ├── book.toml └── src │ ├── README.md │ ├── SUMMARY.md │ ├── attribs.md │ ├── configuration.md │ ├── continuous_integration │ ├── README.md │ ├── github_actions.md │ ├── gitlab.md │ └── travis.md │ ├── development │ ├── README.md │ ├── adding_lints.md │ ├── basics.md │ ├── common_tools_writing_lints.md │ ├── defining_lints.md │ ├── emitting_lints.md │ ├── infrastructure │ │ ├── README.md │ │ ├── backport.md │ │ ├── benchmarking.md │ │ ├── book.md │ │ ├── changelog_update.md │ │ ├── release.md │ │ └── sync.md │ ├── lint_passes.md │ ├── macro_expansions.md │ ├── method_checking.md │ ├── proposals │ │ ├── README.md │ │ ├── roadmap-2021.md │ │ └── syntax-tree-patterns.md │ ├── speedtest.md │ ├── the_team.md │ ├── trait_checking.md │ ├── type_checking.md │ └── writing_tests.md │ ├── installation.md │ ├── lint_configuration.md │ ├── lints.md │ └── usage.md ├── build.rs ├── clippy.toml ├── clippy_config ├── Cargo.toml └── src │ ├── conf.rs │ ├── lib.rs │ ├── metadata.rs │ └── types.rs ├── clippy_dev ├── Cargo.toml └── src │ ├── deprecate_lint.rs │ ├── dogfood.rs │ ├── fmt.rs │ ├── lib.rs │ ├── lint.rs │ ├── main.rs │ ├── new_lint.rs │ ├── release.rs │ ├── rename_lint.rs │ ├── serve.rs │ ├── setup │ ├── git_hook.rs │ ├── intellij.rs │ ├── mod.rs │ ├── toolchain.rs │ └── vscode.rs │ ├── sync.rs │ ├── update_lints.rs │ └── utils.rs ├── clippy_dummy ├── Cargo.toml ├── PUBLISH.md ├── build.rs ├── crates-readme.md └── src │ └── main.rs ├── clippy_lints ├── Cargo.toml ├── README.md └── src │ ├── absolute_paths.rs │ ├── almost_complete_range.rs │ ├── approx_const.rs │ ├── arbitrary_source_item_ordering.rs │ ├── arc_with_non_send_sync.rs │ ├── as_conversions.rs │ ├── asm_syntax.rs │ ├── assertions_on_constants.rs │ ├── assertions_on_result_states.rs │ ├── assigning_clones.rs │ ├── async_yields_async.rs │ ├── attrs │ ├── allow_attributes.rs │ ├── allow_attributes_without_reason.rs │ ├── blanket_clippy_restriction_lints.rs │ ├── deprecated_cfg_attr.rs │ ├── deprecated_semver.rs │ ├── duplicated_attributes.rs │ ├── inline_always.rs │ ├── mixed_attributes_style.rs │ ├── mod.rs │ ├── non_minimal_cfg.rs │ ├── repr_attributes.rs │ ├── should_panic_without_expect.rs │ ├── unnecessary_clippy_cfg.rs │ ├── useless_attribute.rs │ └── utils.rs │ ├── await_holding_invalid.rs │ ├── blocks_in_conditions.rs │ ├── bool_assert_comparison.rs │ ├── bool_to_int_with_if.rs │ ├── booleans.rs │ ├── borrow_deref_ref.rs │ ├── box_default.rs │ ├── byte_char_slices.rs │ ├── cargo │ ├── common_metadata.rs │ ├── feature_name.rs │ ├── lint_groups_priority.rs │ ├── mod.rs │ ├── multiple_crate_versions.rs │ └── wildcard_dependencies.rs │ ├── casts │ ├── as_pointer_underscore.rs │ ├── as_ptr_cast_mut.rs │ ├── as_underscore.rs │ ├── borrow_as_ptr.rs │ ├── cast_abs_to_unsigned.rs │ ├── cast_enum_constructor.rs │ ├── cast_lossless.rs │ ├── cast_nan_to_int.rs │ ├── cast_possible_truncation.rs │ ├── cast_possible_wrap.rs │ ├── cast_precision_loss.rs │ ├── cast_ptr_alignment.rs │ ├── cast_sign_loss.rs │ ├── cast_slice_different_sizes.rs │ ├── cast_slice_from_raw_parts.rs │ ├── char_lit_as_u8.rs │ ├── confusing_method_to_numeric_cast.rs │ ├── fn_to_numeric_cast.rs │ ├── fn_to_numeric_cast_any.rs │ ├── fn_to_numeric_cast_with_truncation.rs │ ├── manual_dangling_ptr.rs │ ├── mod.rs │ ├── ptr_as_ptr.rs │ ├── ptr_cast_constness.rs │ ├── ref_as_ptr.rs │ ├── unnecessary_cast.rs │ ├── utils.rs │ └── zero_ptr.rs │ ├── cfg_not_test.rs │ ├── checked_conversions.rs │ ├── cloned_ref_to_slice_refs.rs │ ├── cognitive_complexity.rs │ ├── collapsible_if.rs │ ├── collection_is_never_read.rs │ ├── comparison_chain.rs │ ├── copies.rs │ ├── copy_iterator.rs │ ├── crate_in_macro_def.rs │ ├── create_dir.rs │ ├── ctfe.rs │ ├── dbg_macro.rs │ ├── declare_clippy_lint.rs │ ├── declared_lints.rs │ ├── default.rs │ ├── default_constructed_unit_structs.rs │ ├── default_instead_of_iter_empty.rs │ ├── default_numeric_fallback.rs │ ├── default_union_representation.rs │ ├── deprecated_lints.rs │ ├── dereference.rs │ ├── derivable_impls.rs │ ├── derive.rs │ ├── disallowed_macros.rs │ ├── disallowed_methods.rs │ ├── disallowed_names.rs │ ├── disallowed_script_idents.rs │ ├── disallowed_types.rs │ ├── doc │ ├── doc_comment_double_space_linebreaks.rs │ ├── include_in_doc_without_cfg.rs │ ├── lazy_continuation.rs │ ├── link_with_quotes.rs │ ├── markdown.rs │ ├── missing_headers.rs │ ├── mod.rs │ ├── needless_doctest_main.rs │ ├── suspicious_doc_comments.rs │ └── too_long_first_doc_paragraph.rs │ ├── double_parens.rs │ ├── drop_forget_ref.rs │ ├── duplicate_mod.rs │ ├── else_if_without_else.rs │ ├── empty_drop.rs │ ├── empty_enum.rs │ ├── empty_line_after.rs │ ├── empty_with_brackets.rs │ ├── endian_bytes.rs │ ├── entry.rs │ ├── enum_clike.rs │ ├── equatable_if_let.rs │ ├── error_impl_error.rs │ ├── escape.rs │ ├── eta_reduction.rs │ ├── excessive_bools.rs │ ├── excessive_nesting.rs │ ├── exhaustive_items.rs │ ├── exit.rs │ ├── explicit_write.rs │ ├── extra_unused_type_parameters.rs │ ├── fallible_impl_from.rs │ ├── field_scoped_visibility_modifiers.rs │ ├── float_literal.rs │ ├── floating_point_arithmetic.rs │ ├── format.rs │ ├── format_args.rs │ ├── format_impl.rs │ ├── format_push_string.rs │ ├── formatting.rs │ ├── four_forward_slashes.rs │ ├── from_over_into.rs │ ├── from_raw_with_void_ptr.rs │ ├── from_str_radix_10.rs │ ├── functions │ ├── impl_trait_in_params.rs │ ├── misnamed_getters.rs │ ├── mod.rs │ ├── must_use.rs │ ├── not_unsafe_ptr_arg_deref.rs │ ├── ref_option.rs │ ├── renamed_function_params.rs │ ├── result.rs │ ├── too_many_arguments.rs │ └── too_many_lines.rs │ ├── future_not_send.rs │ ├── if_let_mutex.rs │ ├── if_not_else.rs │ ├── if_then_some_else_none.rs │ ├── ignored_unit_patterns.rs │ ├── impl_hash_with_borrow_str_and_bytes.rs │ ├── implicit_hasher.rs │ ├── implicit_return.rs │ ├── implicit_saturating_add.rs │ ├── implicit_saturating_sub.rs │ ├── implied_bounds_in_impls.rs │ ├── incompatible_msrv.rs │ ├── inconsistent_struct_constructor.rs │ ├── index_refutable_slice.rs │ ├── indexing_slicing.rs │ ├── ineffective_open_options.rs │ ├── infallible_try_from.rs │ ├── infinite_iter.rs │ ├── inherent_impl.rs │ ├── inherent_to_string.rs │ ├── init_numbered_fields.rs │ ├── inline_fn_without_body.rs │ ├── instant_subtraction.rs │ ├── int_plus_one.rs │ ├── integer_division_remainder_used.rs │ ├── invalid_upcast_comparisons.rs │ ├── item_name_repetitions.rs │ ├── items_after_statements.rs │ ├── items_after_test_module.rs │ ├── iter_not_returning_iterator.rs │ ├── iter_over_hash_type.rs │ ├── iter_without_into_iter.rs │ ├── large_const_arrays.rs │ ├── large_enum_variant.rs │ ├── large_futures.rs │ ├── large_include_file.rs │ ├── large_stack_arrays.rs │ ├── large_stack_frames.rs │ ├── legacy_numeric_constants.rs │ ├── len_zero.rs │ ├── let_if_seq.rs │ ├── let_underscore.rs │ ├── let_with_type_underscore.rs │ ├── lib.rs │ ├── lifetimes.rs │ ├── lines_filter_map_ok.rs │ ├── literal_representation.rs │ ├── literal_string_with_formatting_args.rs │ ├── loops │ ├── char_indices_as_byte_indices.rs │ ├── empty_loop.rs │ ├── explicit_counter_loop.rs │ ├── explicit_into_iter_loop.rs │ ├── explicit_iter_loop.rs │ ├── for_kv_map.rs │ ├── infinite_loop.rs │ ├── iter_next_loop.rs │ ├── manual_find.rs │ ├── manual_flatten.rs │ ├── manual_memcpy.rs │ ├── manual_slice_fill.rs │ ├── manual_while_let_some.rs │ ├── missing_spin_loop.rs │ ├── mod.rs │ ├── mut_range_bound.rs │ ├── needless_range_loop.rs │ ├── never_loop.rs │ ├── same_item_push.rs │ ├── single_element_loop.rs │ ├── unused_enumerate_index.rs │ ├── utils.rs │ ├── while_float.rs │ ├── while_immutable_condition.rs │ ├── while_let_loop.rs │ └── while_let_on_iterator.rs │ ├── macro_metavars_in_unsafe.rs │ ├── macro_use.rs │ ├── main_recursion.rs │ ├── manual_abs_diff.rs │ ├── manual_assert.rs │ ├── manual_async_fn.rs │ ├── manual_bits.rs │ ├── manual_clamp.rs │ ├── manual_div_ceil.rs │ ├── manual_float_methods.rs │ ├── manual_hash_one.rs │ ├── manual_ignore_case_cmp.rs │ ├── manual_is_ascii_check.rs │ ├── manual_is_power_of_two.rs │ ├── manual_let_else.rs │ ├── manual_main_separator_str.rs │ ├── manual_non_exhaustive.rs │ ├── manual_option_as_slice.rs │ ├── manual_range_patterns.rs │ ├── manual_rem_euclid.rs │ ├── manual_retain.rs │ ├── manual_rotate.rs │ ├── manual_slice_size_calculation.rs │ ├── manual_string_new.rs │ ├── manual_strip.rs │ ├── map_unit_fn.rs │ ├── match_result_ok.rs │ ├── matches │ ├── collapsible_match.rs │ ├── infallible_destructuring_match.rs │ ├── manual_filter.rs │ ├── manual_map.rs │ ├── manual_ok_err.rs │ ├── manual_unwrap_or.rs │ ├── manual_utils.rs │ ├── match_as_ref.rs │ ├── match_bool.rs │ ├── match_like_matches.rs │ ├── match_ref_pats.rs │ ├── match_same_arms.rs │ ├── match_single_binding.rs │ ├── match_str_case_mismatch.rs │ ├── match_wild_enum.rs │ ├── match_wild_err_arm.rs │ ├── mod.rs │ ├── needless_match.rs │ ├── overlapping_arms.rs │ ├── redundant_guards.rs │ ├── redundant_pattern_match.rs │ ├── rest_pat_in_fully_bound_struct.rs │ ├── significant_drop_in_scrutinee.rs │ ├── single_match.rs │ ├── try_err.rs │ └── wild_in_or_pats.rs │ ├── mem_replace.rs │ ├── methods │ ├── bind_instead_of_map.rs │ ├── bytecount.rs │ ├── bytes_count_to_len.rs │ ├── bytes_nth.rs │ ├── case_sensitive_file_extension_comparisons.rs │ ├── chars_cmp.rs │ ├── chars_cmp_with_unwrap.rs │ ├── chars_last_cmp.rs │ ├── chars_last_cmp_with_unwrap.rs │ ├── chars_next_cmp.rs │ ├── chars_next_cmp_with_unwrap.rs │ ├── clear_with_drain.rs │ ├── clone_on_copy.rs │ ├── clone_on_ref_ptr.rs │ ├── cloned_instead_of_copied.rs │ ├── collapsible_str_replace.rs │ ├── double_ended_iterator_last.rs │ ├── drain_collect.rs │ ├── err_expect.rs │ ├── expect_fun_call.rs │ ├── extend_with_drain.rs │ ├── filetype_is_file.rs │ ├── filter_map.rs │ ├── filter_map_bool_then.rs │ ├── filter_map_identity.rs │ ├── filter_map_next.rs │ ├── filter_next.rs │ ├── flat_map_identity.rs │ ├── flat_map_option.rs │ ├── format_collect.rs │ ├── from_iter_instead_of_collect.rs │ ├── get_first.rs │ ├── get_last_with_len.rs │ ├── get_unwrap.rs │ ├── implicit_clone.rs │ ├── inefficient_to_string.rs │ ├── inspect_for_each.rs │ ├── into_iter_on_ref.rs │ ├── io_other_error.rs │ ├── is_digit_ascii_radix.rs │ ├── is_empty.rs │ ├── iter_cloned_collect.rs │ ├── iter_count.rs │ ├── iter_filter.rs │ ├── iter_kv_map.rs │ ├── iter_next_slice.rs │ ├── iter_nth.rs │ ├── iter_nth_zero.rs │ ├── iter_on_single_or_empty_collections.rs │ ├── iter_out_of_bounds.rs │ ├── iter_overeager_cloned.rs │ ├── iter_skip_next.rs │ ├── iter_skip_zero.rs │ ├── iter_with_drain.rs │ ├── iterator_step_by_zero.rs │ ├── join_absolute_paths.rs │ ├── manual_c_str_literals.rs │ ├── manual_contains.rs │ ├── manual_inspect.rs │ ├── manual_is_variant_and.rs │ ├── manual_next_back.rs │ ├── manual_ok_or.rs │ ├── manual_repeat_n.rs │ ├── manual_saturating_arithmetic.rs │ ├── manual_str_repeat.rs │ ├── manual_try_fold.rs │ ├── map_all_any_identity.rs │ ├── map_clone.rs │ ├── map_collect_result_unit.rs │ ├── map_err_ignore.rs │ ├── map_flatten.rs │ ├── map_identity.rs │ ├── map_unwrap_or.rs │ ├── map_with_unused_argument_over_ranges.rs │ ├── mod.rs │ ├── mut_mutex_lock.rs │ ├── needless_as_bytes.rs │ ├── needless_character_iteration.rs │ ├── needless_collect.rs │ ├── needless_option_as_deref.rs │ ├── needless_option_take.rs │ ├── no_effect_replace.rs │ ├── obfuscated_if_else.rs │ ├── ok_expect.rs │ ├── open_options.rs │ ├── option_as_ref_cloned.rs │ ├── option_as_ref_deref.rs │ ├── option_map_or_none.rs │ ├── option_map_unwrap_or.rs │ ├── or_fun_call.rs │ ├── or_then_unwrap.rs │ ├── path_buf_push_overwrite.rs │ ├── path_ends_with_ext.rs │ ├── range_zip_with_len.rs │ ├── read_line_without_trim.rs │ ├── readonly_write_lock.rs │ ├── redundant_as_str.rs │ ├── repeat_once.rs │ ├── result_map_or_else_none.rs │ ├── return_and_then.rs │ ├── search_is_some.rs │ ├── seek_from_current.rs │ ├── seek_to_start_instead_of_rewind.rs │ ├── single_char_add_str.rs │ ├── single_char_insert_string.rs │ ├── single_char_push_string.rs │ ├── skip_while_next.rs │ ├── sliced_string_as_bytes.rs │ ├── stable_sort_primitive.rs │ ├── str_split.rs │ ├── str_splitn.rs │ ├── string_extend_chars.rs │ ├── string_lit_chars_any.rs │ ├── suspicious_command_arg_space.rs │ ├── suspicious_map.rs │ ├── suspicious_splitn.rs │ ├── suspicious_to_owned.rs │ ├── swap_with_temporary.rs │ ├── type_id_on_box.rs │ ├── unbuffered_bytes.rs │ ├── uninit_assumed_init.rs │ ├── unit_hash.rs │ ├── unnecessary_fallible_conversions.rs │ ├── unnecessary_filter_map.rs │ ├── unnecessary_first_then_check.rs │ ├── unnecessary_fold.rs │ ├── unnecessary_get_then_check.rs │ ├── unnecessary_iter_cloned.rs │ ├── unnecessary_join.rs │ ├── unnecessary_lazy_eval.rs │ ├── unnecessary_literal_unwrap.rs │ ├── unnecessary_map_or.rs │ ├── unnecessary_min_or_max.rs │ ├── unnecessary_result_map_or_else.rs │ ├── unnecessary_sort_by.rs │ ├── unnecessary_to_owned.rs │ ├── unused_enumerate_index.rs │ ├── unwrap_expect_used.rs │ ├── useless_asref.rs │ ├── useless_nonzero_new_unchecked.rs │ ├── utils.rs │ ├── vec_resize_to_zero.rs │ ├── verbose_file_reads.rs │ ├── waker_clone_wake.rs │ ├── wrong_self_convention.rs │ └── zst_offset.rs │ ├── min_ident_chars.rs │ ├── minmax.rs │ ├── misc.rs │ ├── misc_early │ ├── builtin_type_shadow.rs │ ├── literal_suffix.rs │ ├── mixed_case_hex_literals.rs │ ├── mod.rs │ ├── redundant_at_rest_pattern.rs │ ├── redundant_pattern.rs │ ├── unneeded_field_pattern.rs │ ├── unneeded_wildcard_pattern.rs │ └── zero_prefixed_literal.rs │ ├── mismatching_type_param_order.rs │ ├── missing_assert_message.rs │ ├── missing_asserts_for_indexing.rs │ ├── missing_const_for_fn.rs │ ├── missing_const_for_thread_local.rs │ ├── missing_doc.rs │ ├── missing_enforced_import_rename.rs │ ├── missing_fields_in_debug.rs │ ├── missing_inline.rs │ ├── missing_trait_methods.rs │ ├── mixed_read_write_in_expression.rs │ ├── module_style.rs │ ├── multi_assignments.rs │ ├── multiple_bound_locations.rs │ ├── multiple_unsafe_ops_per_block.rs │ ├── mut_key.rs │ ├── mut_mut.rs │ ├── mut_reference.rs │ ├── mutable_debug_assertion.rs │ ├── mutex_atomic.rs │ ├── needless_arbitrary_self_type.rs │ ├── needless_bool.rs │ ├── needless_borrowed_ref.rs │ ├── needless_borrows_for_generic_args.rs │ ├── needless_continue.rs │ ├── needless_else.rs │ ├── needless_for_each.rs │ ├── needless_if.rs │ ├── needless_late_init.rs │ ├── needless_maybe_sized.rs │ ├── needless_parens_on_range_literals.rs │ ├── needless_pass_by_ref_mut.rs │ ├── needless_pass_by_value.rs │ ├── needless_question_mark.rs │ ├── needless_update.rs │ ├── neg_cmp_op_on_partial_ord.rs │ ├── neg_multiply.rs │ ├── new_without_default.rs │ ├── no_effect.rs │ ├── no_mangle_with_rust_abi.rs │ ├── non_canonical_impls.rs │ ├── non_copy_const.rs │ ├── non_expressive_names.rs │ ├── non_octal_unix_permissions.rs │ ├── non_send_fields_in_send_ty.rs │ ├── non_std_lazy_statics.rs │ ├── non_zero_suggestions.rs │ ├── nonstandard_macro_braces.rs │ ├── octal_escapes.rs │ ├── only_used_in_recursion.rs │ ├── operators │ ├── absurd_extreme_comparisons.rs │ ├── arithmetic_side_effects.rs │ ├── assign_op_pattern.rs │ ├── bit_mask.rs │ ├── cmp_owned.rs │ ├── const_comparisons.rs │ ├── double_comparison.rs │ ├── duration_subsec.rs │ ├── eq_op.rs │ ├── erasing_op.rs │ ├── float_cmp.rs │ ├── float_equality_without_abs.rs │ ├── identity_op.rs │ ├── integer_division.rs │ ├── manual_midpoint.rs │ ├── misrefactored_assign_op.rs │ ├── mod.rs │ ├── modulo_arithmetic.rs │ ├── modulo_one.rs │ ├── needless_bitwise_bool.rs │ ├── numeric_arithmetic.rs │ ├── op_ref.rs │ ├── self_assignment.rs │ └── verbose_bit_mask.rs │ ├── option_env_unwrap.rs │ ├── option_if_let_else.rs │ ├── panic_in_result_fn.rs │ ├── panic_unimplemented.rs │ ├── panicking_overflow_checks.rs │ ├── partial_pub_fields.rs │ ├── partialeq_ne_impl.rs │ ├── partialeq_to_none.rs │ ├── pass_by_ref_or_value.rs │ ├── pathbuf_init_then_push.rs │ ├── pattern_type_mismatch.rs │ ├── permissions_set_readonly_false.rs │ ├── pointers_in_nomem_asm_block.rs │ ├── precedence.rs │ ├── ptr.rs │ ├── ptr_offset_with_cast.rs │ ├── pub_underscore_fields.rs │ ├── pub_use.rs │ ├── question_mark.rs │ ├── question_mark_used.rs │ ├── ranges.rs │ ├── raw_strings.rs │ ├── rc_clone_in_vec_init.rs │ ├── read_zero_byte_vec.rs │ ├── redundant_async_block.rs │ ├── redundant_clone.rs │ ├── redundant_closure_call.rs │ ├── redundant_else.rs │ ├── redundant_field_names.rs │ ├── redundant_locals.rs │ ├── redundant_pub_crate.rs │ ├── redundant_slicing.rs │ ├── redundant_static_lifetimes.rs │ ├── redundant_test_prefix.rs │ ├── redundant_type_annotations.rs │ ├── ref_option_ref.rs │ ├── ref_patterns.rs │ ├── reference.rs │ ├── regex.rs │ ├── repeat_vec_with_capacity.rs │ ├── reserve_after_initialization.rs │ ├── return_self_not_must_use.rs │ ├── returns.rs │ ├── same_name_method.rs │ ├── self_named_constructors.rs │ ├── semicolon_block.rs │ ├── semicolon_if_nothing_returned.rs │ ├── serde_api.rs │ ├── set_contains_or_insert.rs │ ├── shadow.rs │ ├── significant_drop_tightening.rs │ ├── single_call_fn.rs │ ├── single_char_lifetime_names.rs │ ├── single_component_path_imports.rs │ ├── single_option_map.rs │ ├── single_range_in_vec_init.rs │ ├── size_of_in_element_count.rs │ ├── size_of_ref.rs │ ├── slow_vector_initialization.rs │ ├── std_instead_of_core.rs │ ├── string_patterns.rs │ ├── strings.rs │ ├── strlen_on_c_strings.rs │ ├── suspicious_operation_groupings.rs │ ├── suspicious_trait_impl.rs │ ├── suspicious_xor_used_as_pow.rs │ ├── swap.rs │ ├── swap_ptr_to_ref.rs │ ├── tabs_in_doc_comments.rs │ ├── temporary_assignment.rs │ ├── tests_outside_test_module.rs │ ├── to_digit_is_some.rs │ ├── to_string_trait_impl.rs │ ├── trailing_empty_array.rs │ ├── trait_bounds.rs │ ├── transmute │ ├── crosspointer_transmute.rs │ ├── eager_transmute.rs │ ├── missing_transmute_annotations.rs │ ├── mod.rs │ ├── transmute_int_to_bool.rs │ ├── transmute_int_to_non_zero.rs │ ├── transmute_null_to_fn.rs │ ├── transmute_ptr_to_ptr.rs │ ├── transmute_ptr_to_ref.rs │ ├── transmute_ref_to_ref.rs │ ├── transmute_undefined_repr.rs │ ├── transmutes_expressible_as_ptr_casts.rs │ ├── transmuting_null.rs │ ├── unsound_collection_transmute.rs │ ├── useless_transmute.rs │ ├── utils.rs │ └── wrong_transmute.rs │ ├── tuple_array_conversions.rs │ ├── types │ ├── borrowed_box.rs │ ├── box_collection.rs │ ├── linked_list.rs │ ├── mod.rs │ ├── option_option.rs │ ├── owned_cow.rs │ ├── rc_buffer.rs │ ├── rc_mutex.rs │ ├── redundant_allocation.rs │ ├── type_complexity.rs │ ├── utils.rs │ └── vec_box.rs │ ├── unconditional_recursion.rs │ ├── undocumented_unsafe_blocks.rs │ ├── unicode.rs │ ├── uninhabited_references.rs │ ├── uninit_vec.rs │ ├── unit_return_expecting_ord.rs │ ├── unit_types │ ├── let_unit_value.rs │ ├── mod.rs │ ├── unit_arg.rs │ ├── unit_cmp.rs │ └── utils.rs │ ├── unnecessary_box_returns.rs │ ├── unnecessary_literal_bound.rs │ ├── unnecessary_map_on_constructor.rs │ ├── unnecessary_owned_empty_strings.rs │ ├── unnecessary_self_imports.rs │ ├── unnecessary_semicolon.rs │ ├── unnecessary_struct_initialization.rs │ ├── unnecessary_wraps.rs │ ├── unneeded_struct_pattern.rs │ ├── unnested_or_patterns.rs │ ├── unsafe_removed_from_name.rs │ ├── unused_async.rs │ ├── unused_io_amount.rs │ ├── unused_peekable.rs │ ├── unused_result_ok.rs │ ├── unused_rounding.rs │ ├── unused_self.rs │ ├── unused_trait_names.rs │ ├── unused_unit.rs │ ├── unwrap.rs │ ├── unwrap_in_result.rs │ ├── upper_case_acronyms.rs │ ├── use_self.rs │ ├── useless_concat.rs │ ├── useless_conversion.rs │ ├── utils │ ├── attr_collector.rs │ ├── author.rs │ ├── dump_hir.rs │ ├── format_args_collector.rs │ └── mod.rs │ ├── vec.rs │ ├── vec_init_then_push.rs │ ├── visibility.rs │ ├── wildcard_imports.rs │ ├── write.rs │ ├── zero_div_zero.rs │ ├── zero_repeat_side_effects.rs │ ├── zero_sized_map_values.rs │ └── zombie_processes.rs ├── clippy_lints_internal ├── Cargo.toml └── src │ ├── almost_standard_lint_formulation.rs │ ├── collapsible_calls.rs │ ├── derive_deserialize_allowing_unknown.rs │ ├── internal_paths.rs │ ├── lib.rs │ ├── lint_without_lint_pass.rs │ ├── msrv_attr_impl.rs │ ├── outer_expn_data_pass.rs │ ├── produce_ice.rs │ ├── symbols.rs │ ├── unnecessary_def_path.rs │ └── unsorted_clippy_utils_paths.rs ├── clippy_utils ├── Cargo.toml ├── README.md └── src │ ├── ast_utils │ ├── ident_iter.rs │ └── mod.rs │ ├── attrs.rs │ ├── check_proc_macro.rs │ ├── comparisons.rs │ ├── consts.rs │ ├── diagnostics.rs │ ├── eager_or_lazy.rs │ ├── higher.rs │ ├── hir_utils.rs │ ├── lib.rs │ ├── macros.rs │ ├── mir │ ├── mod.rs │ ├── possible_borrower.rs │ ├── possible_origin.rs │ └── transitive_relation.rs │ ├── msrvs.rs │ ├── numeric_literal.rs │ ├── paths.rs │ ├── ptr.rs │ ├── qualify_min_const_fn.rs │ ├── source.rs │ ├── str_utils.rs │ ├── sugg.rs │ ├── sym.rs │ ├── ty │ ├── mod.rs │ └── type_certainty │ │ ├── certainty.rs │ │ └── mod.rs │ ├── usage.rs │ └── visitors.rs ├── etc └── relicense │ ├── RELICENSE_DOCUMENTATION.md │ ├── contributors.txt │ └── relicense_comments.txt ├── lintcheck ├── Cargo.toml ├── README.md ├── ci-config │ └── clippy.toml ├── ci_crates.toml ├── lintcheck_crates.toml ├── src │ ├── config.rs │ ├── driver.rs │ ├── input.rs │ ├── json.rs │ ├── main.rs │ ├── output.rs │ ├── popular_crates.rs │ └── recursive.rs └── test_sources.toml ├── rust-toolchain.toml ├── rustc_tools_util ├── CHANGELOG.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md └── src │ └── lib.rs ├── rustfmt.toml ├── src ├── driver.rs └── main.rs ├── tests ├── check-fmt.rs ├── clippy.toml ├── compile-test.rs ├── config-metadata.rs ├── dogfood.rs ├── integration.rs ├── lint_message_convention.rs ├── missing-test-files.rs ├── test_utils │ └── mod.rs ├── ui-cargo │ ├── cargo_common_metadata │ │ ├── fail │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_publish │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_publish_true │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass_publish_empty │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── pass_publish_false │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── main.rs │ ├── cargo_rust_version │ │ ├── fail_both_diff │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_both_same │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_cargo │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_clippy │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail_file_attr │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass_both_same │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass_cargo │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass_clippy │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── pass_file_attr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── warn_both_diff │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ └── main.rs │ ├── duplicate_mod │ │ └── fail │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── a.rs │ │ │ ├── b.rs │ │ │ ├── c.rs │ │ │ ├── d.rs │ │ │ ├── from_other_module.rs │ │ │ ├── main.rs │ │ │ └── other_module │ │ │ └── mod.rs │ ├── feature_name │ │ ├── fail │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── pass │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── main.rs │ ├── lint_groups_priority │ │ ├── fail │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── lib.rs │ │ └── pass │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── module_style │ │ ├── fail_mod │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── bad │ │ │ │ ├── inner.rs │ │ │ │ ├── inner │ │ │ │ │ ├── stuff.rs │ │ │ │ │ └── stuff │ │ │ │ │ │ └── most.rs │ │ │ │ └── mod.rs │ │ │ │ └── main.rs │ │ ├── fail_mod_remap │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── bad.rs │ │ │ │ ├── bad │ │ │ │ └── inner.rs │ │ │ │ └── main.rs │ │ ├── fail_no_mod │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── bad │ │ │ │ └── mod.rs │ │ │ │ └── main.rs │ │ ├── pass_mod │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── bad │ │ │ │ └── mod.rs │ │ │ │ ├── main.rs │ │ │ │ └── more │ │ │ │ ├── foo.rs │ │ │ │ ├── inner │ │ │ │ └── mod.rs │ │ │ │ └── mod.rs │ │ └── pass_no_mod │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ ├── good.rs │ │ │ └── main.rs │ ├── multiple_config_files │ │ ├── no_warn │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── warn │ │ │ ├── .clippy.toml │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ └── main.rs │ ├── multiple_crate_versions │ │ ├── 12145_with_dashes │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── 12176_allow_duplicate_crates │ │ │ ├── Cargo.toml │ │ │ ├── clippy.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── 5041_allow_dev_build │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ ├── fail │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.stderr │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ └── main.rs │ │ └── pass │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── main.rs │ ├── update-all-references.sh │ └── wildcard_dependencies │ │ ├── fail │ │ ├── Cargo.stderr │ │ ├── Cargo.toml │ │ └── src │ │ │ └── main.rs │ │ └── pass │ │ ├── Cargo.toml │ │ └── src │ │ └── main.rs ├── ui-internal │ ├── check_clippy_version_attribute.rs │ ├── check_clippy_version_attribute.stderr │ ├── check_formulation.rs │ ├── check_formulation.stderr │ ├── collapsible_span_lint_calls.fixed │ ├── collapsible_span_lint_calls.rs │ ├── collapsible_span_lint_calls.stderr │ ├── custom_ice_message.rs │ ├── custom_ice_message.stderr │ ├── default_lint.rs │ ├── default_lint.stderr │ ├── derive_deserialize_allowing_unknown.rs │ ├── derive_deserialize_allowing_unknown.stderr │ ├── disallow_span_lint.rs │ ├── disallow_span_lint.stderr │ ├── interning_literals.fixed │ ├── interning_literals.rs │ ├── interning_literals.stderr │ ├── interning_literals_unfixable.rs │ ├── interning_literals_unfixable.stderr │ ├── invalid_msrv_attr_impl.fixed │ ├── invalid_msrv_attr_impl.rs │ ├── invalid_msrv_attr_impl.stderr │ ├── lint_without_lint_pass.rs │ ├── lint_without_lint_pass.stderr │ ├── outer_expn_data.fixed │ ├── outer_expn_data.rs │ ├── outer_expn_data.stderr │ ├── symbol_as_str.fixed │ ├── symbol_as_str.rs │ ├── symbol_as_str.stderr │ ├── symbol_as_str_unfixable.rs │ ├── symbol_as_str_unfixable.stderr │ ├── unnecessary_def_path.rs │ └── unnecessary_def_path.stderr ├── ui-toml │ ├── absolute_paths │ │ ├── absolute_paths.allow_crates.stderr │ │ ├── absolute_paths.allow_long.stderr │ │ ├── absolute_paths.default.stderr │ │ ├── absolute_paths.no_short.stderr │ │ ├── absolute_paths.rs │ │ ├── absolute_paths_2015.default.stderr │ │ ├── absolute_paths_2015.rs │ │ ├── allow_crates │ │ │ └── clippy.toml │ │ ├── allow_long │ │ │ └── clippy.toml │ │ ├── default │ │ │ └── clippy.toml │ │ └── no_short │ │ │ └── clippy.toml │ ├── allow_mixed_uninlined_format_args │ │ ├── clippy.toml │ │ ├── uninlined_format_args.fixed │ │ ├── uninlined_format_args.rs │ │ └── uninlined_format_args.stderr │ ├── arbitrary_source_item_ordering │ │ ├── bad_conf_1 │ │ │ └── clippy.toml │ │ ├── bad_conf_2 │ │ │ └── clippy.toml │ │ ├── bad_conf_3 │ │ │ └── clippy.toml │ │ ├── bad_conf_4 │ │ │ └── clippy.toml │ │ ├── bad_conf_5 │ │ │ └── clippy.toml │ │ ├── bad_conf_6 │ │ │ └── clippy.toml │ │ ├── default │ │ │ └── clippy.toml │ │ ├── default_exp │ │ │ └── clippy.toml │ │ ├── only_enum │ │ │ └── clippy.toml │ │ ├── only_impl │ │ │ └── clippy.toml │ │ ├── only_trait │ │ │ └── clippy.toml │ │ ├── ord_in_2 │ │ │ └── clippy.toml │ │ ├── ord_in_3 │ │ │ └── clippy.toml │ │ ├── ord_within │ │ │ └── clippy.toml │ │ ├── ordering_good.bad_conf_1.stderr │ │ ├── ordering_good.bad_conf_2.stderr │ │ ├── ordering_good.bad_conf_3.stderr │ │ ├── ordering_good.bad_conf_4.stderr │ │ ├── ordering_good.bad_conf_5.stderr │ │ ├── ordering_good.bad_conf_6.stderr │ │ ├── ordering_good.rs │ │ ├── ordering_good_var_1.rs │ │ ├── ordering_mixed.default.stderr │ │ ├── ordering_mixed.default_exp.stderr │ │ ├── ordering_mixed.ord_within.stderr │ │ ├── ordering_mixed.rs │ │ ├── ordering_mixed_var_1.rs │ │ ├── ordering_mixed_var_1.var_1.stderr │ │ ├── ordering_only_enum.only_enum.stderr │ │ ├── ordering_only_enum.rs │ │ ├── ordering_only_impl.only_impl.stderr │ │ ├── ordering_only_impl.rs │ │ ├── ordering_only_trait.only_trait.stderr │ │ ├── ordering_only_trait.rs │ │ ├── selective_ordering.default.stderr │ │ ├── selective_ordering.ord_in_2.stderr │ │ ├── selective_ordering.ord_in_3.stderr │ │ ├── selective_ordering.ord_within.stderr │ │ ├── selective_ordering.rs │ │ └── var_1 │ │ │ └── clippy.toml │ ├── arithmetic_side_effects_allowed │ │ ├── arithmetic_side_effects_allowed.rs │ │ ├── arithmetic_side_effects_allowed.stderr │ │ └── clippy.toml │ ├── array_size_threshold │ │ ├── array_size_threshold.rs │ │ ├── array_size_threshold.stderr │ │ └── clippy.toml │ ├── await_holding_invalid_type │ │ ├── await_holding_invalid_type.rs │ │ ├── await_holding_invalid_type.stderr │ │ └── clippy.toml │ ├── await_holding_invalid_type_with_replacement │ │ ├── await_holding_invalid_type.rs │ │ ├── await_holding_invalid_type.stderr │ │ └── clippy.toml │ ├── bad_toml │ │ ├── clippy.toml │ │ ├── conf_bad_toml.rs │ │ └── conf_bad_toml.stderr │ ├── bad_toml_type │ │ ├── clippy.toml │ │ ├── conf_bad_type.rs │ │ └── conf_bad_type.stderr │ ├── borrow_interior_mutable_const │ │ ├── clippy.toml │ │ └── ignore.rs │ ├── check_incompatible_msrv_in_tests │ │ ├── check_incompatible_msrv_in_tests.default.stderr │ │ ├── check_incompatible_msrv_in_tests.enabled.stderr │ │ ├── check_incompatible_msrv_in_tests.rs │ │ ├── default │ │ │ └── clippy.toml │ │ └── enabled │ │ │ └── clippy.toml │ ├── collapsible_if │ │ ├── clippy.toml │ │ ├── collapsible_if.fixed │ │ ├── collapsible_if.rs │ │ ├── collapsible_if.stderr │ │ ├── collapsible_if_let_chains.fixed │ │ ├── collapsible_if_let_chains.rs │ │ └── collapsible_if_let_chains.stderr │ ├── conf_deprecated_key │ │ ├── clippy.toml │ │ ├── conf_deprecated_key.rs │ │ └── conf_deprecated_key.stderr │ ├── dbg_macro │ │ ├── clippy.toml │ │ ├── dbg_macro.fixed │ │ ├── dbg_macro.rs │ │ └── dbg_macro.stderr │ ├── decimal_literal_representation │ │ ├── clippy.toml │ │ ├── decimal_literal_representation.fixed │ │ ├── decimal_literal_representation.rs │ │ └── decimal_literal_representation.stderr │ ├── declare_interior_mutable_const │ │ ├── clippy.toml │ │ └── ignore.rs │ ├── disallowed_macros │ │ ├── auxiliary │ │ │ ├── macros.rs │ │ │ └── proc_macros.rs │ │ ├── clippy.toml │ │ ├── disallowed_macros.rs │ │ └── disallowed_macros.stderr │ ├── disallowed_names_append │ │ ├── clippy.toml │ │ ├── disallowed_names.rs │ │ └── disallowed_names.stderr │ ├── disallowed_names_replace │ │ ├── clippy.toml │ │ ├── disallowed_names.rs │ │ └── disallowed_names.stderr │ ├── disallowed_script_idents │ │ ├── clippy.toml │ │ ├── disallowed_script_idents.rs │ │ └── disallowed_script_idents.stderr │ ├── doc_valid_idents_append │ │ ├── clippy.toml │ │ ├── doc_markdown.fixed │ │ ├── doc_markdown.rs │ │ └── doc_markdown.stderr │ ├── doc_valid_idents_replace │ │ ├── clippy.toml │ │ ├── doc_markdown.fixed │ │ ├── doc_markdown.rs │ │ └── doc_markdown.stderr │ ├── duplicated_keys │ │ ├── clippy.toml │ │ ├── duplicated_keys.rs │ │ └── duplicated_keys.stderr │ ├── duplicated_keys_deprecated │ │ ├── clippy.toml │ │ ├── duplicated_keys.rs │ │ └── duplicated_keys.stderr │ ├── duplicated_keys_deprecated_2 │ │ ├── clippy.toml │ │ ├── duplicated_keys.rs │ │ └── duplicated_keys.stderr │ ├── enum_variant_size │ │ ├── clippy.toml │ │ ├── enum_variant_size.fixed │ │ ├── enum_variant_size.rs │ │ └── enum_variant_size.stderr │ ├── excessive_nesting │ │ ├── clippy.toml │ │ ├── excessive_nesting.rs │ │ └── excessive_nesting.stderr │ ├── expect_used │ │ ├── clippy.toml │ │ ├── expect_used.rs │ │ └── expect_used.stderr │ ├── explicit_iter_loop │ │ ├── clippy.toml │ │ ├── explicit_iter_loop.fixed │ │ ├── explicit_iter_loop.rs │ │ └── explicit_iter_loop.stderr │ ├── extra_unused_type_parameters │ │ ├── clippy.toml │ │ └── extra_unused_type_parameters.rs │ ├── fn_params_excessive_bools │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── functions_maxlines │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── good_toml_no_false_negatives │ │ ├── clippy.toml │ │ └── conf_no_false_negatives.rs │ ├── ifs_same_cond │ │ ├── clippy.toml │ │ ├── ifs_same_cond.rs │ │ └── ifs_same_cond.stderr │ ├── impl_trait_in_params │ │ ├── clippy.toml │ │ ├── impl_trait_in_params.rs │ │ └── impl_trait_in_params.stderr │ ├── indexing_slicing │ │ ├── clippy.toml │ │ ├── indexing_slicing.rs │ │ └── indexing_slicing.stderr │ ├── invalid_min_rust_version │ │ ├── clippy.toml │ │ ├── invalid_min_rust_version.rs │ │ └── invalid_min_rust_version.stderr │ ├── item_name_repetitions │ │ ├── allow_exact_repetitions │ │ │ ├── clippy.toml │ │ │ ├── item_name_repetitions.rs │ │ │ └── item_name_repetitions.stderr │ │ ├── allowed_prefixes │ │ │ ├── clippy.toml │ │ │ ├── item_name_repetitions.rs │ │ │ └── item_name_repetitions.stderr │ │ ├── allowed_prefixes_extend │ │ │ ├── clippy.toml │ │ │ ├── item_name_repetitions.rs │ │ │ └── item_name_repetitions.stderr │ │ ├── threshold0 │ │ │ ├── clippy.toml │ │ │ └── item_name_repetitions.rs │ │ └── threshold5 │ │ │ ├── clippy.toml │ │ │ ├── item_name_repetitions.rs │ │ │ └── item_name_repetitions.stderr │ ├── large_futures │ │ ├── clippy.toml │ │ ├── large_futures.fixed │ │ ├── large_futures.rs │ │ └── large_futures.stderr │ ├── large_include_file │ │ ├── clippy.toml │ │ ├── empty.txt │ │ ├── large_include_file.rs │ │ ├── large_include_file.stderr │ │ └── too_big.txt │ ├── large_stack_frames │ │ ├── clippy.toml │ │ ├── large_stack_frames.rs │ │ └── large_stack_frames.stderr │ ├── large_types_passed_by_value │ │ ├── clippy.toml │ │ ├── large_types_passed_by_value.fixed │ │ ├── large_types_passed_by_value.rs │ │ └── large_types_passed_by_value.stderr │ ├── lint_decimal_readability │ │ ├── clippy.toml │ │ ├── test.fixed │ │ ├── test.rs │ │ └── test.stderr │ ├── macro_metavars_in_unsafe │ │ ├── default │ │ │ ├── test.rs │ │ │ └── test.stderr │ │ └── private │ │ │ ├── clippy.toml │ │ │ ├── test.rs │ │ │ └── test.stderr │ ├── manual_let_else │ │ ├── clippy.toml │ │ ├── manual_let_else.fixed │ │ ├── manual_let_else.rs │ │ └── manual_let_else.stderr │ ├── max_suggested_slice_pattern_length │ │ ├── clippy.toml │ │ ├── index_refutable_slice.fixed │ │ ├── index_refutable_slice.rs │ │ └── index_refutable_slice.stderr │ ├── min_ident_chars │ │ ├── auxiliary │ │ │ └── extern_types.rs │ │ ├── clippy.toml │ │ ├── min_ident_chars.rs │ │ └── min_ident_chars.stderr │ ├── min_rust_version │ │ ├── clippy.toml │ │ ├── min_rust_version.fixed │ │ ├── min_rust_version.rs │ │ └── min_rust_version.stderr │ ├── missing_docs_allow_unused │ │ ├── clippy.toml │ │ ├── missing_docs_allow_unused.rs │ │ └── missing_docs_allow_unused.stderr │ ├── missing_enforced_import_rename │ │ ├── clippy.toml │ │ ├── conf_missing_enforced_import_rename.fixed │ │ ├── conf_missing_enforced_import_rename.rs │ │ └── conf_missing_enforced_import_rename.stderr │ ├── module_inception │ │ ├── clippy.toml │ │ ├── module_inception.rs │ │ └── module_inception.stderr │ ├── modulo_arithmetic │ │ ├── clippy.toml │ │ ├── modulo_arithmetic.rs │ │ └── modulo_arithmetic.stderr │ ├── mut_key │ │ ├── clippy.toml │ │ └── mut_key.rs │ ├── needless_pass_by_ref_mut │ │ ├── clippy.toml │ │ ├── needless_pass_by_ref_mut.fixed │ │ ├── needless_pass_by_ref_mut.rs │ │ └── needless_pass_by_ref_mut.stderr │ ├── needless_raw_string_hashes_one_allowed │ │ ├── clippy.toml │ │ ├── needless_raw_string_hashes.fixed │ │ ├── needless_raw_string_hashes.rs │ │ └── needless_raw_string_hashes.stderr │ ├── nonstandard_macro_braces │ │ ├── auxiliary │ │ │ └── proc_macro_derive.rs │ │ ├── clippy.toml │ │ ├── conf_nonstandard_macro_braces.fixed │ │ ├── conf_nonstandard_macro_braces.rs │ │ └── conf_nonstandard_macro_braces.stderr │ ├── panic │ │ ├── clippy.toml │ │ ├── panic.rs │ │ └── panic.stderr │ ├── path_ends_with_ext │ │ ├── clippy.toml │ │ └── path_ends_with_ext.rs │ ├── print_macro │ │ ├── clippy.toml │ │ ├── print_macro.rs │ │ └── print_macro.stderr │ ├── private-doc-errors │ │ ├── clippy.toml │ │ ├── doc_lints.rs │ │ └── doc_lints.stderr │ ├── pub_crate_missing_docs │ │ ├── clippy.toml │ │ ├── pub_crate_missing_doc.rs │ │ └── pub_crate_missing_doc.stderr │ ├── pub_underscore_fields │ │ ├── all_pub_fields │ │ │ └── clippy.toml │ │ ├── exported │ │ │ └── clippy.toml │ │ ├── pub_underscore_fields.all_pub_fields.stderr │ │ ├── pub_underscore_fields.exported.stderr │ │ └── pub_underscore_fields.rs │ ├── renamed_function_params │ │ ├── default │ │ │ └── clippy.toml │ │ ├── extend │ │ │ └── clippy.toml │ │ ├── renamed_function_params.default.stderr │ │ ├── renamed_function_params.extend.stderr │ │ └── renamed_function_params.rs │ ├── replaceable_disallowed_types │ │ ├── clippy.toml │ │ ├── replaceable_disallowed_types.fixed │ │ ├── replaceable_disallowed_types.rs │ │ └── replaceable_disallowed_types.stderr │ ├── result_large_err │ │ ├── clippy.toml │ │ ├── result_large_err.rs │ │ └── result_large_err.stderr │ ├── semicolon_block │ │ ├── both.fixed │ │ ├── both.rs │ │ ├── both.stderr │ │ ├── clippy.toml │ │ ├── semicolon_inside_block.fixed │ │ ├── semicolon_inside_block.rs │ │ ├── semicolon_inside_block.stderr │ │ ├── semicolon_outside_block.fixed │ │ ├── semicolon_outside_block.rs │ │ └── semicolon_outside_block.stderr │ ├── strict_non_send_fields_in_send_ty │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── struct_excessive_bools │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── suppress_lint_in_const │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── toml_disallow │ │ ├── clippy.toml │ │ ├── conf_french_disallowed_name.rs │ │ └── conf_french_disallowed_name.stderr │ ├── toml_disallowed_methods │ │ ├── clippy.toml │ │ ├── conf_disallowed_methods.rs │ │ └── conf_disallowed_methods.stderr │ ├── toml_disallowed_types │ │ ├── clippy.toml │ │ ├── conf_disallowed_types.rs │ │ └── conf_disallowed_types.stderr │ ├── toml_inconsistent_struct_constructor │ │ ├── clippy.toml │ │ ├── conf_inconsistent_struct_constructor.fixed │ │ ├── conf_inconsistent_struct_constructor.rs │ │ └── conf_inconsistent_struct_constructor.stderr │ ├── toml_invalid_path │ │ ├── clippy.toml │ │ ├── conf_invalid_path.rs │ │ └── conf_invalid_path.stderr │ ├── toml_replaceable_disallowed_methods │ │ ├── clippy.toml │ │ ├── replaceable_disallowed_methods.fixed │ │ ├── replaceable_disallowed_methods.rs │ │ └── replaceable_disallowed_methods.stderr │ ├── toml_trivially_copy │ │ ├── clippy.toml │ │ ├── test.rs │ │ └── test.stderr │ ├── toml_unknown_config_struct_field │ │ ├── clippy.toml │ │ ├── toml_unknown_config_struct_field.rs │ │ └── toml_unknown_config_struct_field.stderr │ ├── toml_unknown_key │ │ ├── clippy.toml │ │ ├── conf_unknown_key.rs │ │ └── conf_unknown_key.stderr │ ├── toml_unloaded_crate │ │ ├── clippy.toml │ │ ├── conf_unloaded_crate.rs │ │ └── conf_unloaded_crate.stderr │ ├── too_large_for_stack │ │ ├── boxed_local.rs │ │ ├── boxed_local.stderr │ │ ├── clippy.toml │ │ ├── useless_vec.fixed │ │ ├── useless_vec.rs │ │ └── useless_vec.stderr │ ├── too_many_arguments │ │ ├── clippy.toml │ │ ├── too_many_arguments.rs │ │ └── too_many_arguments.stderr │ ├── type_complexity │ │ ├── clippy.toml │ │ ├── type_complexity.rs │ │ └── type_complexity.stderr │ ├── type_repetition_in_bounds │ │ ├── clippy.toml │ │ ├── main.rs │ │ └── main.stderr │ ├── undocumented_unsafe_blocks │ │ ├── default │ │ │ └── clippy.toml │ │ ├── disabled │ │ │ └── clippy.toml │ │ ├── undocumented_unsafe_blocks.default.stderr │ │ ├── undocumented_unsafe_blocks.disabled.stderr │ │ └── undocumented_unsafe_blocks.rs │ ├── unnecessary_box_returns │ │ ├── clippy.toml │ │ ├── unnecessary_box_returns.fixed │ │ ├── unnecessary_box_returns.rs │ │ └── unnecessary_box_returns.stderr │ ├── unwrap_used │ │ ├── clippy.toml │ │ ├── unwrap_used.fixed │ │ ├── unwrap_used.rs │ │ ├── unwrap_used.stderr │ │ ├── unwrap_used_const.rs │ │ └── unwrap_used_const.stderr │ ├── update-all-references.sh │ ├── upper_case_acronyms_aggressive │ │ ├── clippy.toml │ │ ├── upper_case_acronyms.fixed │ │ ├── upper_case_acronyms.rs │ │ └── upper_case_acronyms.stderr │ ├── useless_vec │ │ ├── clippy.toml │ │ ├── useless_vec.fixed │ │ ├── useless_vec.rs │ │ └── useless_vec.stderr │ ├── vec_box_sized │ │ ├── clippy.toml │ │ ├── test.fixed │ │ ├── test.rs │ │ └── test.stderr │ ├── verbose_bit_mask │ │ ├── clippy.toml │ │ ├── verbose_bit_mask.fixed │ │ ├── verbose_bit_mask.rs │ │ └── verbose_bit_mask.stderr │ ├── wildcard_imports │ │ ├── clippy.toml │ │ ├── wildcard_imports.fixed │ │ ├── wildcard_imports.rs │ │ └── wildcard_imports.stderr │ ├── wildcard_imports_whitelist │ │ ├── clippy.toml │ │ ├── wildcard_imports.fixed │ │ ├── wildcard_imports.rs │ │ └── wildcard_imports.stderr │ └── zero_single_char_names │ │ ├── clippy.toml │ │ └── zero_single_char_names.rs ├── ui │ ├── absurd-extreme-comparisons.rs │ ├── absurd-extreme-comparisons.stderr │ ├── allow_attributes.fixed │ ├── allow_attributes.rs │ ├── allow_attributes.stderr │ ├── allow_attributes_without_reason.rs │ ├── allow_attributes_without_reason.stderr │ ├── almost_complete_range.fixed │ ├── almost_complete_range.rs │ ├── almost_complete_range.stderr │ ├── approx_const.rs │ ├── approx_const.stderr │ ├── arc_with_non_send_sync.rs │ ├── arc_with_non_send_sync.stderr │ ├── arithmetic_side_effects.rs │ ├── arithmetic_side_effects.stderr │ ├── as_conversions.rs │ ├── as_conversions.stderr │ ├── as_pointer_underscore.fixed │ ├── as_pointer_underscore.rs │ ├── as_pointer_underscore.stderr │ ├── as_ptr_cast_mut.rs │ ├── as_ptr_cast_mut.stderr │ ├── as_underscore.fixed │ ├── as_underscore.rs │ ├── as_underscore.stderr │ ├── asm_syntax_not_x86.rs │ ├── asm_syntax_x86.i686.stderr │ ├── asm_syntax_x86.rs │ ├── asm_syntax_x86.stderr │ ├── asm_syntax_x86.x86_64.stderr │ ├── assertions_on_constants.rs │ ├── assertions_on_constants.stderr │ ├── assertions_on_result_states.fixed │ ├── assertions_on_result_states.rs │ ├── assertions_on_result_states.stderr │ ├── assign_ops.fixed │ ├── assign_ops.rs │ ├── assign_ops.stderr │ ├── assigning_clones.fixed │ ├── assigning_clones.rs │ ├── assigning_clones.stderr │ ├── async_yields_async.fixed │ ├── async_yields_async.rs │ ├── async_yields_async.stderr │ ├── attrs.rs │ ├── attrs.stderr │ ├── author.rs │ ├── author.stdout │ ├── author │ │ ├── blocks.rs │ │ ├── blocks.stdout │ │ ├── call.rs │ │ ├── call.stdout │ │ ├── if.rs │ │ ├── if.stdout │ │ ├── issue_3849.rs │ │ ├── issue_3849.stdout │ │ ├── loop.rs │ │ ├── loop.stdout │ │ ├── macro_in_closure.rs │ │ ├── macro_in_closure.stdout │ │ ├── macro_in_loop.rs │ │ ├── macro_in_loop.stdout │ │ ├── matches.rs │ │ ├── matches.stdout │ │ ├── repeat.rs │ │ ├── repeat.stdout │ │ ├── struct.rs │ │ └── struct.stdout │ ├── auxiliary │ │ ├── extern_fake_libc.rs │ │ ├── external_consts.rs │ │ ├── external_item.rs │ │ ├── interior_mutable_const.rs │ │ ├── macro_rules.rs │ │ ├── macro_use_helper.rs │ │ ├── non-exhaustive-enum.rs │ │ ├── option_helpers.rs │ │ ├── proc_macro_attr.rs │ │ ├── proc_macro_derive.rs │ │ ├── proc_macro_suspicious_else_formatting.rs │ │ ├── proc_macro_unsafe.rs │ │ ├── proc_macros.rs │ │ ├── test_macro.rs │ │ ├── use_self_macro.rs │ │ └── wildcard_imports_helper.rs │ ├── await_holding_lock.rs │ ├── await_holding_lock.stderr │ ├── await_holding_refcell_ref.rs │ ├── await_holding_refcell_ref.stderr │ ├── bind_instead_of_map.fixed │ ├── bind_instead_of_map.rs │ ├── bind_instead_of_map.stderr │ ├── bind_instead_of_map_multipart.fixed │ ├── bind_instead_of_map_multipart.rs │ ├── bind_instead_of_map_multipart.stderr │ ├── bit_masks.rs │ ├── bit_masks.stderr │ ├── blanket_clippy_restriction_lints.rs │ ├── blanket_clippy_restriction_lints.stderr │ ├── blocks_in_conditions.fixed │ ├── blocks_in_conditions.rs │ ├── blocks_in_conditions.stderr │ ├── blocks_in_conditions_2021.fixed │ ├── blocks_in_conditions_2021.rs │ ├── blocks_in_conditions_2021.stderr │ ├── bool_assert_comparison.fixed │ ├── bool_assert_comparison.rs │ ├── bool_assert_comparison.stderr │ ├── bool_comparison.fixed │ ├── bool_comparison.rs │ ├── bool_comparison.stderr │ ├── bool_to_int_with_if.fixed │ ├── bool_to_int_with_if.rs │ ├── bool_to_int_with_if.stderr │ ├── borrow_and_ref_as_ptr.fixed │ ├── borrow_and_ref_as_ptr.rs │ ├── borrow_and_ref_as_ptr.stderr │ ├── borrow_as_ptr.fixed │ ├── borrow_as_ptr.rs │ ├── borrow_as_ptr.stderr │ ├── borrow_as_ptr_no_std.fixed │ ├── borrow_as_ptr_no_std.rs │ ├── borrow_as_ptr_no_std.stderr │ ├── borrow_as_ptr_raw_ref.fixed │ ├── borrow_as_ptr_raw_ref.rs │ ├── borrow_as_ptr_raw_ref.stderr │ ├── borrow_box.fixed │ ├── borrow_box.rs │ ├── borrow_box.stderr │ ├── borrow_deref_ref.fixed │ ├── borrow_deref_ref.rs │ ├── borrow_deref_ref.stderr │ ├── borrow_deref_ref_unfixable.rs │ ├── borrow_deref_ref_unfixable.stderr │ ├── borrow_interior_mutable_const.rs │ ├── borrow_interior_mutable_const.stderr │ ├── box_collection.rs │ ├── box_collection.stderr │ ├── box_default.fixed │ ├── box_default.rs │ ├── box_default.stderr │ ├── box_default_no_std.rs │ ├── boxed_local.rs │ ├── boxed_local.stderr │ ├── branches_sharing_code │ │ ├── false_positives.rs │ │ ├── shared_at_bottom.rs │ │ ├── shared_at_bottom.stderr │ │ ├── shared_at_top.rs │ │ ├── shared_at_top.stderr │ │ ├── shared_at_top_and_bottom.rs │ │ ├── shared_at_top_and_bottom.stderr │ │ ├── valid_if_blocks.rs │ │ └── valid_if_blocks.stderr │ ├── builtin_type_shadow.rs │ ├── builtin_type_shadow.stderr │ ├── byte_char_slices.fixed │ ├── byte_char_slices.rs │ ├── byte_char_slices.stderr │ ├── bytecount.rs │ ├── bytecount.stderr │ ├── bytes_count_to_len.fixed │ ├── bytes_count_to_len.rs │ ├── bytes_count_to_len.stderr │ ├── bytes_nth.fixed │ ├── bytes_nth.rs │ ├── bytes_nth.stderr │ ├── case_sensitive_file_extension_comparisons.fixed │ ├── case_sensitive_file_extension_comparisons.rs │ ├── case_sensitive_file_extension_comparisons.stderr │ ├── cast.rs │ ├── cast.stderr │ ├── cast_abs_to_unsigned.fixed │ ├── cast_abs_to_unsigned.rs │ ├── cast_abs_to_unsigned.stderr │ ├── cast_alignment.rs │ ├── cast_alignment.stderr │ ├── cast_enum_constructor.rs │ ├── cast_enum_constructor.stderr │ ├── cast_lossless_bool.fixed │ ├── cast_lossless_bool.rs │ ├── cast_lossless_bool.stderr │ ├── cast_lossless_float.fixed │ ├── cast_lossless_float.rs │ ├── cast_lossless_float.stderr │ ├── cast_lossless_integer.fixed │ ├── cast_lossless_integer.rs │ ├── cast_lossless_integer.stderr │ ├── cast_nan_to_int.rs │ ├── cast_nan_to_int.stderr │ ├── cast_raw_slice_pointer_cast.fixed │ ├── cast_raw_slice_pointer_cast.rs │ ├── cast_raw_slice_pointer_cast.stderr │ ├── cast_size.32bit.stderr │ ├── cast_size.64bit.stderr │ ├── cast_size.rs │ ├── cast_slice_different_sizes.rs │ ├── cast_slice_different_sizes.stderr │ ├── cfg_attr_cargo_clippy.fixed │ ├── cfg_attr_cargo_clippy.rs │ ├── cfg_attr_cargo_clippy.stderr │ ├── cfg_attr_rustfmt.fixed │ ├── cfg_attr_rustfmt.rs │ ├── cfg_attr_rustfmt.stderr │ ├── cfg_not_test.rs │ ├── cfg_not_test.stderr │ ├── char_indices_as_byte_indices.fixed │ ├── char_indices_as_byte_indices.rs │ ├── char_indices_as_byte_indices.stderr │ ├── char_lit_as_u8.rs │ ├── char_lit_as_u8.stderr │ ├── char_lit_as_u8_suggestions.fixed │ ├── char_lit_as_u8_suggestions.rs │ ├── char_lit_as_u8_suggestions.stderr │ ├── checked_conversions.fixed │ ├── checked_conversions.rs │ ├── checked_conversions.stderr │ ├── checked_unwrap │ │ ├── complex_conditionals.rs │ │ ├── complex_conditionals.stderr │ │ ├── complex_conditionals_nested.rs │ │ ├── complex_conditionals_nested.stderr │ │ ├── simple_conditionals.rs │ │ └── simple_conditionals.stderr │ ├── clear_with_drain.fixed │ ├── clear_with_drain.rs │ ├── clear_with_drain.stderr │ ├── clone_on_copy.fixed │ ├── clone_on_copy.rs │ ├── clone_on_copy.stderr │ ├── clone_on_copy_impl.rs │ ├── cloned_instead_of_copied.fixed │ ├── cloned_instead_of_copied.rs │ ├── cloned_instead_of_copied.stderr │ ├── cloned_ref_to_slice_refs.fixed │ ├── cloned_ref_to_slice_refs.rs │ ├── cloned_ref_to_slice_refs.stderr │ ├── cmp_null.fixed │ ├── cmp_null.rs │ ├── cmp_null.stderr │ ├── cmp_owned │ │ ├── asymmetric_partial_eq.fixed │ │ ├── asymmetric_partial_eq.rs │ │ ├── asymmetric_partial_eq.stderr │ │ ├── comparison_flip.fixed │ │ ├── comparison_flip.rs │ │ ├── comparison_flip.stderr │ │ ├── with_suggestion.fixed │ │ ├── with_suggestion.rs │ │ ├── with_suggestion.stderr │ │ ├── without_suggestion.rs │ │ └── without_suggestion.stderr │ ├── cognitive_complexity.rs │ ├── cognitive_complexity.stderr │ ├── cognitive_complexity_attr_used.rs │ ├── cognitive_complexity_attr_used.stderr │ ├── collapsible_else_if.fixed │ ├── collapsible_else_if.rs │ ├── collapsible_else_if.stderr │ ├── collapsible_if.fixed │ ├── collapsible_if.rs │ ├── collapsible_if.stderr │ ├── collapsible_if_let_chains.edition2024.fixed │ ├── collapsible_if_let_chains.edition2024.stderr │ ├── collapsible_if_let_chains.rs │ ├── collapsible_match.rs │ ├── collapsible_match.stderr │ ├── collapsible_match2.rs │ ├── collapsible_match2.stderr │ ├── collapsible_str_replace.fixed │ ├── collapsible_str_replace.rs │ ├── collapsible_str_replace.stderr │ ├── collection_is_never_read.rs │ ├── collection_is_never_read.stderr │ ├── comparison_chain.rs │ ├── comparison_chain.stderr │ ├── comparison_to_empty.fixed │ ├── comparison_to_empty.rs │ ├── comparison_to_empty.stderr │ ├── confusing_method_to_numeric_cast.fixed │ ├── confusing_method_to_numeric_cast.rs │ ├── confusing_method_to_numeric_cast.stderr │ ├── const_comparisons.rs │ ├── const_comparisons.stderr │ ├── const_is_empty.rs │ ├── const_is_empty.stderr │ ├── copy_iterator.rs │ ├── copy_iterator.stderr │ ├── crashes │ │ ├── associated-constant-ice.rs │ │ ├── auxiliary │ │ │ ├── ice-4727-aux.rs │ │ │ ├── ice-7272-aux.rs │ │ │ ├── ice-7868-aux.rs │ │ │ ├── ice-7934-aux.rs │ │ │ ├── ice-8681-aux.rs │ │ │ ├── proc_macro_crash.rs │ │ │ └── use_self_macro.rs │ │ ├── cc_seme.rs │ │ ├── elidable_lifetime_names_impl_trait.fixed │ │ ├── elidable_lifetime_names_impl_trait.rs │ │ ├── elidable_lifetime_names_impl_trait.stderr │ │ ├── enum-glob-import-crate.rs │ │ ├── ice-10148.rs │ │ ├── ice-10148.stderr │ │ ├── ice-10508a.rs │ │ ├── ice-10508b.rs │ │ ├── ice-10508c.rs │ │ ├── ice-10912.rs │ │ ├── ice-10912.stderr │ │ ├── ice-11065.rs │ │ ├── ice-11230.fixed │ │ ├── ice-11230.rs │ │ ├── ice-11230.stderr │ │ ├── ice-11337.rs │ │ ├── ice-11422.fixed │ │ ├── ice-11422.rs │ │ ├── ice-11422.stderr │ │ ├── ice-11755.rs │ │ ├── ice-11803.rs │ │ ├── ice-11803.stderr │ │ ├── ice-11939.rs │ │ ├── ice-12253.rs │ │ ├── ice-12491.fixed │ │ ├── ice-12491.rs │ │ ├── ice-12491.stderr │ │ ├── ice-12585.rs │ │ ├── ice-12616.fixed │ │ ├── ice-12616.rs │ │ ├── ice-12616.stderr │ │ ├── ice-12979.1.fixed │ │ ├── ice-12979.2.fixed │ │ ├── ice-12979.rs │ │ ├── ice-12979.stderr │ │ ├── ice-13544-original.rs │ │ ├── ice-13544-reduced.rs │ │ ├── ice-13862.rs │ │ ├── ice-14303.rs │ │ ├── ice-14325.rs │ │ ├── ice-1588.rs │ │ ├── ice-1782.rs │ │ ├── ice-1969.rs │ │ ├── ice-2499.rs │ │ ├── ice-2594.rs │ │ ├── ice-2727.rs │ │ ├── ice-2760.rs │ │ ├── ice-2774.fixed │ │ ├── ice-2774.rs │ │ ├── ice-2774.stderr │ │ ├── ice-2862.rs │ │ ├── ice-2865.rs │ │ ├── ice-3151.rs │ │ ├── ice-3462.rs │ │ ├── ice-360.rs │ │ ├── ice-360.stderr │ │ ├── ice-3717.fixed │ │ ├── ice-3717.rs │ │ ├── ice-3717.stderr │ │ ├── ice-3741.rs │ │ ├── ice-3747.rs │ │ ├── ice-3891.rs │ │ ├── ice-3891.stderr │ │ ├── ice-3969.rs │ │ ├── ice-3969.stderr │ │ ├── ice-4121.rs │ │ ├── ice-4545.rs │ │ ├── ice-4579.rs │ │ ├── ice-4671.rs │ │ ├── ice-4727.rs │ │ ├── ice-4760.rs │ │ ├── ice-4775.rs │ │ ├── ice-4968.rs │ │ ├── ice-5207.rs │ │ ├── ice-5223.rs │ │ ├── ice-5238.rs │ │ ├── ice-5389.rs │ │ ├── ice-5497.rs │ │ ├── ice-5497.stderr │ │ ├── ice-5579.rs │ │ ├── ice-5835.1.fixed │ │ ├── ice-5835.2.fixed │ │ ├── ice-5835.fixed │ │ ├── ice-5835.rs │ │ ├── ice-5835.stderr │ │ ├── ice-5872.fixed │ │ ├── ice-5872.rs │ │ ├── ice-5872.stderr │ │ ├── ice-5944.rs │ │ ├── ice-6139.rs │ │ ├── ice-6153.rs │ │ ├── ice-6179.rs │ │ ├── ice-6250.rs │ │ ├── ice-6250.stderr │ │ ├── ice-6251.rs │ │ ├── ice-6251.stderr │ │ ├── ice-6252.rs │ │ ├── ice-6252.stderr │ │ ├── ice-6254.rs │ │ ├── ice-6255.rs │ │ ├── ice-6255.stderr │ │ ├── ice-6256.rs │ │ ├── ice-6256.stderr │ │ ├── ice-6332.rs │ │ ├── ice-6539.rs │ │ ├── ice-6792.rs │ │ ├── ice-6793.rs │ │ ├── ice-6840.rs │ │ ├── ice-700.rs │ │ ├── ice-7012.rs │ │ ├── ice-7126.rs │ │ ├── ice-7169.fixed │ │ ├── ice-7169.rs │ │ ├── ice-7169.stderr │ │ ├── ice-7231.rs │ │ ├── ice-7272.rs │ │ ├── ice-7340.rs │ │ ├── ice-7410.rs │ │ ├── ice-7423.rs │ │ ├── ice-7868.rs │ │ ├── ice-7868.stderr │ │ ├── ice-7869.rs │ │ ├── ice-7869.stderr │ │ ├── ice-7934.rs │ │ ├── ice-8250.fixed │ │ ├── ice-8250.rs │ │ ├── ice-8250.stderr │ │ ├── ice-8386.rs │ │ ├── ice-8681.rs │ │ ├── ice-8821.rs │ │ ├── ice-8850.fixed │ │ ├── ice-8850.rs │ │ ├── ice-8850.stderr │ │ ├── ice-9041.rs │ │ ├── ice-9041.stderr │ │ ├── ice-9238.rs │ │ ├── ice-9242.rs │ │ ├── ice-9405.rs │ │ ├── ice-9405.stderr │ │ ├── ice-9414.rs │ │ ├── ice-9459.rs │ │ ├── ice-9463.rs │ │ ├── ice-9463.stderr │ │ ├── ice-9625.rs │ │ ├── ice-96721.fixed │ │ ├── ice-96721.rs │ │ ├── ice-96721.stderr │ │ ├── ice-9746.rs │ │ ├── ice-rust-107877.rs │ │ ├── ice_exact_size.rs │ │ ├── if_same_then_else.rs │ │ ├── implements-trait.rs │ │ ├── inherent_impl.rs │ │ ├── issue-825.rs │ │ ├── issues_loop_mut_cond.rs │ │ ├── match_same_arms_const.rs │ │ ├── missing_const_for_fn_14774.fixed │ │ ├── missing_const_for_fn_14774.rs │ │ ├── missing_const_for_fn_14774.stderr │ │ ├── needless_borrow_fp.rs │ │ ├── needless_pass_by_value-w-late-bound.fixed │ │ ├── needless_pass_by_value-w-late-bound.rs │ │ ├── needless_pass_by_value-w-late-bound.stderr │ │ ├── regressions.rs │ │ ├── returns.rs │ │ ├── shadow.rs │ │ ├── single-match-else.rs │ │ ├── third-party │ │ │ ├── clippy.toml │ │ │ └── conf_allowlisted.rs │ │ ├── trivial_bounds.rs │ │ ├── unreachable-array-or-slice.rs │ │ ├── unreachable-array-or-slice.stderr │ │ └── used_underscore_binding_macro.rs │ ├── crate_in_macro_def.fixed │ ├── crate_in_macro_def.rs │ ├── crate_in_macro_def.stderr │ ├── crate_level_checks │ │ ├── entrypoint_recursion.rs │ │ ├── no_std_swap.fixed │ │ ├── no_std_swap.rs │ │ ├── no_std_swap.stderr │ │ ├── std_main_recursion.rs │ │ └── std_main_recursion.stderr │ ├── create_dir.fixed │ ├── create_dir.rs │ ├── create_dir.stderr │ ├── dbg_macro │ │ ├── auxiliary │ │ │ └── submodule.rs │ │ ├── dbg_macro.fixed │ │ ├── dbg_macro.rs │ │ ├── dbg_macro.stderr │ │ ├── dbg_macro_unfixable.rs │ │ └── dbg_macro_unfixable.stderr │ ├── debug_assert_with_mut_call.rs │ ├── debug_assert_with_mut_call.stderr │ ├── decimal_literal_representation.fixed │ ├── decimal_literal_representation.rs │ ├── decimal_literal_representation.stderr │ ├── declare_interior_mutable_const.rs │ ├── declare_interior_mutable_const.stderr │ ├── def_id_nocore.rs │ ├── def_id_nocore.stderr │ ├── default_constructed_unit_structs.fixed │ ├── default_constructed_unit_structs.rs │ ├── default_constructed_unit_structs.stderr │ ├── default_instead_of_iter_empty.fixed │ ├── default_instead_of_iter_empty.rs │ ├── default_instead_of_iter_empty.stderr │ ├── default_instead_of_iter_empty_no_std.fixed │ ├── default_instead_of_iter_empty_no_std.rs │ ├── default_instead_of_iter_empty_no_std.stderr │ ├── default_numeric_fallback_f64.fixed │ ├── default_numeric_fallback_f64.rs │ ├── default_numeric_fallback_f64.stderr │ ├── default_numeric_fallback_i32.fixed │ ├── default_numeric_fallback_i32.rs │ ├── default_numeric_fallback_i32.stderr │ ├── default_trait_access.fixed │ ├── default_trait_access.rs │ ├── default_trait_access.stderr │ ├── default_union_representation.rs │ ├── default_union_representation.stderr │ ├── deprecated.rs │ ├── deprecated.stderr │ ├── deref_addrof.fixed │ ├── deref_addrof.rs │ ├── deref_addrof.stderr │ ├── deref_addrof_double_trigger.rs │ ├── deref_addrof_double_trigger.stderr │ ├── deref_addrof_macro.rs │ ├── deref_by_slicing.fixed │ ├── deref_by_slicing.rs │ ├── deref_by_slicing.stderr │ ├── derivable_impls.fixed │ ├── derivable_impls.rs │ ├── derivable_impls.stderr │ ├── derive.rs │ ├── derive.stderr │ ├── derive_ord_xor_partial_ord.rs │ ├── derive_ord_xor_partial_ord.stderr │ ├── derive_partial_eq_without_eq.fixed │ ├── derive_partial_eq_without_eq.rs │ ├── derive_partial_eq_without_eq.stderr │ ├── derived_hash_with_manual_eq.rs │ ├── derived_hash_with_manual_eq.stderr │ ├── disallowed_names.rs │ ├── disallowed_names.stderr │ ├── disallowed_script_idents.rs │ ├── disallowed_script_idents.stderr │ ├── diverging_sub_expression.rs │ ├── diverging_sub_expression.stderr │ ├── doc │ │ ├── doc-fixable.fixed │ │ ├── doc-fixable.rs │ │ ├── doc-fixable.stderr │ │ ├── doc_comment_double_space_linebreaks.fixed │ │ ├── doc_comment_double_space_linebreaks.rs │ │ ├── doc_comment_double_space_linebreaks.stderr │ │ ├── doc_include_without_cfg.fixed │ │ ├── doc_include_without_cfg.rs │ │ ├── doc_include_without_cfg.stderr │ │ ├── doc_lazy_blockquote.fixed │ │ ├── doc_lazy_blockquote.rs │ │ ├── doc_lazy_blockquote.stderr │ │ ├── doc_lazy_list.fixed │ │ ├── doc_lazy_list.rs │ │ ├── doc_lazy_list.stderr │ │ ├── doc_markdown-issue_13097.fixed │ │ ├── doc_markdown-issue_13097.rs │ │ ├── doc_markdown-issue_13097.stderr │ │ ├── doc_nested_refdef_blockquote.fixed │ │ ├── doc_nested_refdef_blockquote.rs │ │ ├── doc_nested_refdef_blockquote.stderr │ │ ├── doc_nested_refdef_list_item.fixed │ │ ├── doc_nested_refdef_list_item.rs │ │ ├── doc_nested_refdef_list_item.stderr │ │ ├── doc_overindented_list_items.fixed │ │ ├── doc_overindented_list_items.rs │ │ ├── doc_overindented_list_items.stderr │ │ ├── footnote_issue_13183.rs │ │ ├── issue_10262.fixed │ │ ├── issue_10262.rs │ │ ├── issue_10262.stderr │ │ ├── issue_12795.fixed │ │ ├── issue_12795.rs │ │ ├── issue_12795.stderr │ │ ├── issue_1832.rs │ │ ├── issue_902.rs │ │ ├── issue_9473.fixed │ │ ├── issue_9473.rs │ │ ├── issue_9473.stderr │ │ ├── link_adjacent.fixed │ │ ├── link_adjacent.rs │ │ ├── link_adjacent.stderr │ │ ├── needless_doctest_main.rs │ │ ├── unbalanced_ticks.rs │ │ └── unbalanced_ticks.stderr │ ├── doc_errors.rs │ ├── doc_errors.stderr │ ├── doc_link_with_quotes.rs │ ├── doc_link_with_quotes.stderr │ ├── doc_unsafe.rs │ ├── doc_unsafe.stderr │ ├── double_comparison.fixed │ ├── double_comparison.rs │ ├── double_comparison.stderr │ ├── double_ended_iterator_last.fixed │ ├── double_ended_iterator_last.rs │ ├── double_ended_iterator_last.stderr │ ├── double_ended_iterator_last_unfixable.rs │ ├── double_ended_iterator_last_unfixable.stderr │ ├── double_must_use.rs │ ├── double_must_use.stderr │ ├── double_parens.rs │ ├── double_parens.stderr │ ├── drain_collect.fixed │ ├── drain_collect.rs │ ├── drain_collect.stderr │ ├── drain_collect_nostd.fixed │ ├── drain_collect_nostd.rs │ ├── drain_collect_nostd.stderr │ ├── drop_non_drop.rs │ ├── drop_non_drop.stderr │ ├── duplicate_underscore_argument.rs │ ├── duplicate_underscore_argument.stderr │ ├── duplicated_attributes.rs │ ├── duplicated_attributes.stderr │ ├── duration_subsec.fixed │ ├── duration_subsec.rs │ ├── duration_subsec.stderr │ ├── eager_transmute.fixed │ ├── eager_transmute.rs │ ├── eager_transmute.stderr │ ├── elidable_lifetime_names.fixed │ ├── elidable_lifetime_names.rs │ ├── elidable_lifetime_names.stderr │ ├── else_if_without_else.rs │ ├── else_if_without_else.stderr │ ├── empty_docs.rs │ ├── empty_docs.stderr │ ├── empty_drop.fixed │ ├── empty_drop.rs │ ├── empty_drop.stderr │ ├── empty_enum.rs │ ├── empty_enum.stderr │ ├── empty_enum_variants_with_brackets.fixed │ ├── empty_enum_variants_with_brackets.rs │ ├── empty_enum_variants_with_brackets.stderr │ ├── empty_enum_without_never_type.rs │ ├── empty_line_after │ │ ├── doc_comments.1.fixed │ │ ├── doc_comments.2.fixed │ │ ├── doc_comments.rs │ │ ├── doc_comments.stderr │ │ ├── outer_attribute.1.fixed │ │ ├── outer_attribute.2.fixed │ │ ├── outer_attribute.rs │ │ └── outer_attribute.stderr │ ├── empty_loop.rs │ ├── empty_loop.stderr │ ├── empty_loop_no_std.rs │ ├── empty_loop_no_std.stderr │ ├── empty_structs_with_brackets.fixed │ ├── empty_structs_with_brackets.rs │ ├── empty_structs_with_brackets.stderr │ ├── endian_bytes.rs │ ├── endian_bytes.stderr │ ├── entry.fixed │ ├── entry.rs │ ├── entry.stderr │ ├── entry_btree.fixed │ ├── entry_btree.rs │ ├── entry_btree.stderr │ ├── entry_unfixable.rs │ ├── entry_unfixable.stderr │ ├── entry_with_else.fixed │ ├── entry_with_else.rs │ ├── entry_with_else.stderr │ ├── enum_clike_unportable_variant.rs │ ├── enum_clike_unportable_variant.stderr │ ├── enum_glob_use.fixed │ ├── enum_glob_use.rs │ ├── enum_glob_use.stderr │ ├── enum_variants.rs │ ├── enum_variants.stderr │ ├── eprint_with_newline.fixed │ ├── eprint_with_newline.rs │ ├── eprint_with_newline.stderr │ ├── eq_op.rs │ ├── eq_op.stderr │ ├── eq_op_macros.rs │ ├── eq_op_macros.stderr │ ├── equatable_if_let.fixed │ ├── equatable_if_let.rs │ ├── equatable_if_let.stderr │ ├── erasing_op.rs │ ├── erasing_op.stderr │ ├── err_expect.fixed │ ├── err_expect.rs │ ├── err_expect.stderr │ ├── error_impl_error.rs │ ├── error_impl_error.stderr │ ├── eta.fixed │ ├── eta.rs │ ├── eta.stderr │ ├── eta_nostd.fixed │ ├── eta_nostd.rs │ ├── eta_nostd.stderr │ ├── excessive_precision.fixed │ ├── excessive_precision.rs │ ├── excessive_precision.stderr │ ├── exhaustive_items.fixed │ ├── exhaustive_items.rs │ ├── exhaustive_items.stderr │ ├── exit1.rs │ ├── exit1.stderr │ ├── exit2.rs │ ├── exit2.stderr │ ├── exit3.rs │ ├── expect.rs │ ├── expect.stderr │ ├── expect_fun_call.fixed │ ├── expect_fun_call.rs │ ├── expect_fun_call.stderr │ ├── expect_tool_lint_rfc_2383.rs │ ├── expect_tool_lint_rfc_2383.stderr │ ├── explicit_auto_deref.fixed │ ├── explicit_auto_deref.rs │ ├── explicit_auto_deref.stderr │ ├── explicit_counter_loop.rs │ ├── explicit_counter_loop.stderr │ ├── explicit_deref_methods.fixed │ ├── explicit_deref_methods.rs │ ├── explicit_deref_methods.stderr │ ├── explicit_into_iter_loop.fixed │ ├── explicit_into_iter_loop.rs │ ├── explicit_into_iter_loop.stderr │ ├── explicit_iter_loop.fixed │ ├── explicit_iter_loop.rs │ ├── explicit_iter_loop.stderr │ ├── explicit_write.fixed │ ├── explicit_write.rs │ ├── explicit_write.stderr │ ├── extend_with_drain.fixed │ ├── extend_with_drain.rs │ ├── extend_with_drain.stderr │ ├── extra_unused_lifetimes.rs │ ├── extra_unused_lifetimes.stderr │ ├── extra_unused_type_parameters.fixed │ ├── extra_unused_type_parameters.rs │ ├── extra_unused_type_parameters.stderr │ ├── extra_unused_type_parameters_unfixable.rs │ ├── extra_unused_type_parameters_unfixable.stderr │ ├── fallible_impl_from.rs │ ├── fallible_impl_from.stderr │ ├── field_reassign_with_default.rs │ ├── field_reassign_with_default.stderr │ ├── field_scoped_visibility_modifiers.rs │ ├── field_scoped_visibility_modifiers.stderr │ ├── filetype_is_file.rs │ ├── filetype_is_file.stderr │ ├── filter_map_bool_then.fixed │ ├── filter_map_bool_then.rs │ ├── filter_map_bool_then.stderr │ ├── filter_map_bool_then_unfixable.rs │ ├── filter_map_bool_then_unfixable.stderr │ ├── filter_map_identity.fixed │ ├── filter_map_identity.rs │ ├── filter_map_identity.stderr │ ├── filter_map_next.rs │ ├── filter_map_next.stderr │ ├── filter_map_next_fixable.fixed │ ├── filter_map_next_fixable.rs │ ├── filter_map_next_fixable.stderr │ ├── find_map.rs │ ├── flat_map_identity.fixed │ ├── flat_map_identity.rs │ ├── flat_map_identity.stderr │ ├── flat_map_option.fixed │ ├── flat_map_option.rs │ ├── flat_map_option.stderr │ ├── float_arithmetic.rs │ ├── float_arithmetic.stderr │ ├── float_cmp.rs │ ├── float_cmp.stderr │ ├── float_cmp_const.rs │ ├── float_cmp_const.stderr │ ├── float_equality_without_abs.rs │ ├── float_equality_without_abs.stderr │ ├── floating_point_abs.fixed │ ├── floating_point_abs.rs │ ├── floating_point_abs.stderr │ ├── floating_point_arithmetic_nostd.rs │ ├── floating_point_exp.fixed │ ├── floating_point_exp.rs │ ├── floating_point_exp.stderr │ ├── floating_point_hypot.fixed │ ├── floating_point_hypot.rs │ ├── floating_point_hypot.stderr │ ├── floating_point_log.fixed │ ├── floating_point_log.rs │ ├── floating_point_log.stderr │ ├── floating_point_logbase.fixed │ ├── floating_point_logbase.rs │ ├── floating_point_logbase.stderr │ ├── floating_point_mul_add.fixed │ ├── floating_point_mul_add.rs │ ├── floating_point_mul_add.stderr │ ├── floating_point_powf.fixed │ ├── floating_point_powf.rs │ ├── floating_point_powf.stderr │ ├── floating_point_powi.fixed │ ├── floating_point_powi.rs │ ├── floating_point_powi.stderr │ ├── floating_point_rad.fixed │ ├── floating_point_rad.rs │ ├── floating_point_rad.stderr │ ├── fn_params_excessive_bools.rs │ ├── fn_params_excessive_bools.stderr │ ├── fn_to_numeric_cast.32bit.stderr │ ├── fn_to_numeric_cast.64bit.stderr │ ├── fn_to_numeric_cast.rs │ ├── fn_to_numeric_cast_any.rs │ ├── fn_to_numeric_cast_any.stderr │ ├── for_kv_map.fixed │ ├── for_kv_map.rs │ ├── for_kv_map.stderr │ ├── forget_non_drop.rs │ ├── forget_non_drop.stderr │ ├── format.fixed │ ├── format.rs │ ├── format.stderr │ ├── format_args.fixed │ ├── format_args.rs │ ├── format_args.stderr │ ├── format_args_unfixable.rs │ ├── format_args_unfixable.stderr │ ├── format_collect.rs │ ├── format_collect.stderr │ ├── format_push_string.rs │ ├── format_push_string.stderr │ ├── formatting.rs │ ├── formatting.stderr │ ├── four_forward_slashes.fixed │ ├── four_forward_slashes.rs │ ├── four_forward_slashes.stderr │ ├── four_forward_slashes_first_line.fixed │ ├── four_forward_slashes_first_line.rs │ ├── four_forward_slashes_first_line.stderr │ ├── from_iter_instead_of_collect.fixed │ ├── from_iter_instead_of_collect.rs │ ├── from_iter_instead_of_collect.stderr │ ├── from_over_into.fixed │ ├── from_over_into.rs │ ├── from_over_into.stderr │ ├── from_over_into_unfixable.rs │ ├── from_over_into_unfixable.stderr │ ├── from_raw_with_void_ptr.rs │ ├── from_raw_with_void_ptr.stderr │ ├── from_str_radix_10.fixed │ ├── from_str_radix_10.rs │ ├── from_str_radix_10.stderr │ ├── functions.rs │ ├── functions.stderr │ ├── functions_maxlines.rs │ ├── functions_maxlines.stderr │ ├── future_not_send.rs │ ├── future_not_send.stderr │ ├── get_first.fixed │ ├── get_first.rs │ ├── get_first.stderr │ ├── get_last_with_len.fixed │ ├── get_last_with_len.rs │ ├── get_last_with_len.stderr │ ├── get_unwrap.fixed │ ├── get_unwrap.rs │ ├── get_unwrap.stderr │ ├── identity_op.fixed │ ├── identity_op.rs │ ├── identity_op.stderr │ ├── if_let_mutex.edition2021.stderr │ ├── if_let_mutex.rs │ ├── if_not_else.fixed │ ├── if_not_else.rs │ ├── if_not_else.stderr │ ├── if_not_else_bittest.rs │ ├── if_same_then_else.rs │ ├── if_same_then_else.stderr │ ├── if_same_then_else2.rs │ ├── if_same_then_else2.stderr │ ├── if_then_some_else_none.fixed │ ├── if_then_some_else_none.rs │ ├── if_then_some_else_none.stderr │ ├── ifs_same_cond.rs │ ├── ifs_same_cond.stderr │ ├── ignore_without_reason.rs │ ├── ignore_without_reason.stderr │ ├── ignored_unit_patterns.fixed │ ├── ignored_unit_patterns.rs │ ├── ignored_unit_patterns.stderr │ ├── impl.rs │ ├── impl.stderr │ ├── impl_hash_with_borrow_str_and_bytes.rs │ ├── impl_hash_with_borrow_str_and_bytes.stderr │ ├── impl_trait_in_params.rs │ ├── impl_trait_in_params.stderr │ ├── implicit_clone.fixed │ ├── implicit_clone.rs │ ├── implicit_clone.stderr │ ├── implicit_hasher.fixed │ ├── implicit_hasher.rs │ ├── implicit_hasher.stderr │ ├── implicit_return.fixed │ ├── implicit_return.rs │ ├── implicit_return.stderr │ ├── implicit_saturating_add.fixed │ ├── implicit_saturating_add.rs │ ├── implicit_saturating_add.stderr │ ├── implicit_saturating_sub.fixed │ ├── implicit_saturating_sub.rs │ ├── implicit_saturating_sub.stderr │ ├── implied_bounds_in_impls.fixed │ ├── implied_bounds_in_impls.rs │ ├── implied_bounds_in_impls.stderr │ ├── incompatible_msrv.rs │ ├── incompatible_msrv.stderr │ ├── inconsistent_digit_grouping.fixed │ ├── inconsistent_digit_grouping.rs │ ├── inconsistent_digit_grouping.stderr │ ├── inconsistent_struct_constructor.fixed │ ├── inconsistent_struct_constructor.rs │ ├── inconsistent_struct_constructor.stderr │ ├── index_refutable_slice │ │ ├── if_let_slice_binding.fixed │ │ ├── if_let_slice_binding.rs │ │ ├── if_let_slice_binding.stderr │ │ ├── slice_indexing_in_macro.fixed │ │ ├── slice_indexing_in_macro.rs │ │ └── slice_indexing_in_macro.stderr │ ├── indexing_slicing_index.rs │ ├── indexing_slicing_index.stderr │ ├── indexing_slicing_slice.rs │ ├── indexing_slicing_slice.stderr │ ├── ineffective_open_options.fixed │ ├── ineffective_open_options.rs │ ├── ineffective_open_options.stderr │ ├── inefficient_to_string.fixed │ ├── inefficient_to_string.rs │ ├── inefficient_to_string.stderr │ ├── infallible_destructuring_match.fixed │ ├── infallible_destructuring_match.rs │ ├── infallible_destructuring_match.stderr │ ├── infallible_try_from.rs │ ├── infallible_try_from.stderr │ ├── infinite_iter.rs │ ├── infinite_iter.stderr │ ├── infinite_loop.rs │ ├── infinite_loop.stderr │ ├── infinite_loops.rs │ ├── infinite_loops.stderr │ ├── inherent_to_string.rs │ ├── inherent_to_string.stderr │ ├── init_numbered_fields.fixed │ ├── init_numbered_fields.rs │ ├── init_numbered_fields.stderr │ ├── inline_fn_without_body.fixed │ ├── inline_fn_without_body.rs │ ├── inline_fn_without_body.stderr │ ├── inspect_for_each.rs │ ├── inspect_for_each.stderr │ ├── int_plus_one.fixed │ ├── int_plus_one.rs │ ├── int_plus_one.stderr │ ├── integer_division.rs │ ├── integer_division.stderr │ ├── integer_division_remainder_used.rs │ ├── integer_division_remainder_used.stderr │ ├── into_iter_on_ref.fixed │ ├── into_iter_on_ref.rs │ ├── into_iter_on_ref.stderr │ ├── into_iter_without_iter.rs │ ├── into_iter_without_iter.stderr │ ├── invalid_upcast_comparisons.rs │ ├── invalid_upcast_comparisons.stderr │ ├── io_other_error.fixed │ ├── io_other_error.rs │ ├── io_other_error.stderr │ ├── is_digit_ascii_radix.fixed │ ├── is_digit_ascii_radix.rs │ ├── is_digit_ascii_radix.stderr │ ├── issue-111399.rs │ ├── issue-3145.rs │ ├── issue-3145.stderr │ ├── issue-7447.rs │ ├── issue-7447.stderr │ ├── issue_2356.fixed │ ├── issue_2356.rs │ ├── issue_2356.stderr │ ├── issue_4266.rs │ ├── issue_4266.stderr │ ├── items_after_statement.rs │ ├── items_after_statement.stderr │ ├── items_after_test_module │ │ ├── after_proc_macros.rs │ │ ├── auxiliary │ │ │ ├── submodule.rs │ │ │ └── tests.rs │ │ ├── imported_module.rs │ │ ├── in_submodule.rs │ │ ├── in_submodule.stderr │ │ ├── multiple_modules.rs │ │ ├── root_module.fixed │ │ ├── root_module.rs │ │ └── root_module.stderr │ ├── iter_cloned_collect.fixed │ ├── iter_cloned_collect.rs │ ├── iter_cloned_collect.stderr │ ├── iter_count.fixed │ ├── iter_count.rs │ ├── iter_count.stderr │ ├── iter_filter_is_ok.fixed │ ├── iter_filter_is_ok.rs │ ├── iter_filter_is_ok.stderr │ ├── iter_filter_is_some.fixed │ ├── iter_filter_is_some.rs │ ├── iter_filter_is_some.stderr │ ├── iter_kv_map.fixed │ ├── iter_kv_map.rs │ ├── iter_kv_map.stderr │ ├── iter_next_loop.rs │ ├── iter_next_loop.stderr │ ├── iter_next_slice.fixed │ ├── iter_next_slice.rs │ ├── iter_next_slice.stderr │ ├── iter_not_returning_iterator.rs │ ├── iter_not_returning_iterator.stderr │ ├── iter_nth.fixed │ ├── iter_nth.rs │ ├── iter_nth.stderr │ ├── iter_nth_zero.fixed │ ├── iter_nth_zero.rs │ ├── iter_nth_zero.stderr │ ├── iter_on_empty_collections.fixed │ ├── iter_on_empty_collections.rs │ ├── iter_on_empty_collections.stderr │ ├── iter_on_single_items.fixed │ ├── iter_on_single_items.rs │ ├── iter_on_single_items.stderr │ ├── iter_out_of_bounds.rs │ ├── iter_out_of_bounds.stderr │ ├── iter_over_hash_type.rs │ ├── iter_over_hash_type.stderr │ ├── iter_overeager_cloned.fixed │ ├── iter_overeager_cloned.rs │ ├── iter_overeager_cloned.stderr │ ├── iter_skip_next.fixed │ ├── iter_skip_next.rs │ ├── iter_skip_next.stderr │ ├── iter_skip_next_unfixable.rs │ ├── iter_skip_next_unfixable.stderr │ ├── iter_skip_zero.fixed │ ├── iter_skip_zero.rs │ ├── iter_skip_zero.stderr │ ├── iter_with_drain.fixed │ ├── iter_with_drain.rs │ ├── iter_with_drain.stderr │ ├── iter_without_into_iter.rs │ ├── iter_without_into_iter.stderr │ ├── iterator_step_by_zero.rs │ ├── iterator_step_by_zero.stderr │ ├── join_absolute_paths.rs │ ├── join_absolute_paths.stderr │ ├── large_const_arrays.fixed │ ├── large_const_arrays.rs │ ├── large_const_arrays.stderr │ ├── large_digit_groups.fixed │ ├── large_digit_groups.rs │ ├── large_digit_groups.stderr │ ├── large_enum_variant.32bit.stderr │ ├── large_enum_variant.64bit.stderr │ ├── large_enum_variant.rs │ ├── large_futures.fixed │ ├── large_futures.rs │ ├── large_futures.stderr │ ├── large_stack_arrays.rs │ ├── large_stack_arrays.stderr │ ├── large_stack_frames.rs │ ├── large_stack_frames.stderr │ ├── large_types_passed_by_value.rs │ ├── large_types_passed_by_value.stderr │ ├── legacy_numeric_constants.fixed │ ├── legacy_numeric_constants.rs │ ├── legacy_numeric_constants.stderr │ ├── legacy_numeric_constants_unfixable.rs │ ├── legacy_numeric_constants_unfixable.stderr │ ├── len_without_is_empty.rs │ ├── len_without_is_empty.stderr │ ├── len_without_is_empty_expect.rs │ ├── len_without_is_empty_expect.stderr │ ├── len_zero.fixed │ ├── len_zero.rs │ ├── len_zero.stderr │ ├── len_zero_ranges.fixed │ ├── len_zero_ranges.rs │ ├── len_zero_ranges.stderr │ ├── let_and_return.edition2021.fixed │ ├── let_and_return.edition2021.stderr │ ├── let_and_return.edition2024.fixed │ ├── let_and_return.edition2024.stderr │ ├── let_and_return.fixed │ ├── let_and_return.rs │ ├── let_and_return.stderr │ ├── let_if_seq.rs │ ├── let_if_seq.stderr │ ├── let_underscore_future.rs │ ├── let_underscore_future.stderr │ ├── let_underscore_lock.rs │ ├── let_underscore_lock.stderr │ ├── let_underscore_must_use.rs │ ├── let_underscore_must_use.stderr │ ├── let_underscore_untyped.rs │ ├── let_underscore_untyped.stderr │ ├── let_unit.fixed │ ├── let_unit.rs │ ├── let_unit.stderr │ ├── let_with_type_underscore.fixed │ ├── let_with_type_underscore.rs │ ├── let_with_type_underscore.stderr │ ├── lines_filter_map_ok.fixed │ ├── lines_filter_map_ok.rs │ ├── lines_filter_map_ok.stderr │ ├── linkedlist.rs │ ├── linkedlist.stderr │ ├── literal_string_with_formatting_arg.rs │ ├── literal_string_with_formatting_arg.stderr │ ├── literals.rs │ ├── literals.stderr │ ├── lossy_float_literal.fixed │ ├── lossy_float_literal.rs │ ├── lossy_float_literal.stderr │ ├── macro_use_imports.fixed │ ├── macro_use_imports.rs │ ├── macro_use_imports.stderr │ ├── macro_use_imports_expect.rs │ ├── manual_abs_diff.fixed │ ├── manual_abs_diff.rs │ ├── manual_abs_diff.stderr │ ├── manual_arithmetic_check-2.rs │ ├── manual_arithmetic_check-2.stderr │ ├── manual_arithmetic_check.fixed │ ├── manual_arithmetic_check.rs │ ├── manual_arithmetic_check.stderr │ ├── manual_assert.edition2018.stderr │ ├── manual_assert.edition2021.stderr │ ├── manual_assert.rs │ ├── manual_async_fn.fixed │ ├── manual_async_fn.rs │ ├── manual_async_fn.stderr │ ├── manual_bits.fixed │ ├── manual_bits.rs │ ├── manual_bits.stderr │ ├── manual_c_str_literals.edition2021.fixed │ ├── manual_c_str_literals.edition2021.stderr │ ├── manual_c_str_literals.rs │ ├── manual_clamp.fixed │ ├── manual_clamp.rs │ ├── manual_clamp.stderr │ ├── manual_contains.fixed │ ├── manual_contains.rs │ ├── manual_contains.stderr │ ├── manual_dangling_ptr.fixed │ ├── manual_dangling_ptr.rs │ ├── manual_dangling_ptr.stderr │ ├── manual_div_ceil.fixed │ ├── manual_div_ceil.rs │ ├── manual_div_ceil.stderr │ ├── manual_div_ceil_with_feature.fixed │ ├── manual_div_ceil_with_feature.rs │ ├── manual_div_ceil_with_feature.stderr │ ├── manual_filter.fixed │ ├── manual_filter.rs │ ├── manual_filter.stderr │ ├── manual_filter_map.fixed │ ├── manual_filter_map.rs │ ├── manual_filter_map.stderr │ ├── manual_find.rs │ ├── manual_find.stderr │ ├── manual_find_fixable.fixed │ ├── manual_find_fixable.rs │ ├── manual_find_fixable.stderr │ ├── manual_find_map.fixed │ ├── manual_find_map.rs │ ├── manual_find_map.stderr │ ├── manual_flatten.rs │ ├── manual_flatten.stderr │ ├── manual_float_methods.rs │ ├── manual_float_methods.stderr │ ├── manual_hash_one.fixed │ ├── manual_hash_one.rs │ ├── manual_hash_one.stderr │ ├── manual_ignore_case_cmp.fixed │ ├── manual_ignore_case_cmp.rs │ ├── manual_ignore_case_cmp.stderr │ ├── manual_inspect.fixed │ ├── manual_inspect.rs │ ├── manual_inspect.stderr │ ├── manual_instant_elapsed.fixed │ ├── manual_instant_elapsed.rs │ ├── manual_instant_elapsed.stderr │ ├── manual_is_ascii_check.fixed │ ├── manual_is_ascii_check.rs │ ├── manual_is_ascii_check.stderr │ ├── manual_is_power_of_two.fixed │ ├── manual_is_power_of_two.rs │ ├── manual_is_power_of_two.stderr │ ├── manual_is_variant_and.fixed │ ├── manual_is_variant_and.rs │ ├── manual_is_variant_and.stderr │ ├── manual_let_else.rs │ ├── manual_let_else.stderr │ ├── manual_let_else_match.fixed │ ├── manual_let_else_match.rs │ ├── manual_let_else_match.stderr │ ├── manual_let_else_question_mark.fixed │ ├── manual_let_else_question_mark.rs │ ├── manual_let_else_question_mark.stderr │ ├── manual_main_separator_str.fixed │ ├── manual_main_separator_str.rs │ ├── manual_main_separator_str.stderr │ ├── manual_map_option.fixed │ ├── manual_map_option.rs │ ├── manual_map_option.stderr │ ├── manual_map_option_2.fixed │ ├── manual_map_option_2.rs │ ├── manual_map_option_2.stderr │ ├── manual_memcpy │ │ ├── with_loop_counters.rs │ │ ├── with_loop_counters.stderr │ │ ├── without_loop_counters.rs │ │ └── without_loop_counters.stderr │ ├── manual_midpoint.fixed │ ├── manual_midpoint.rs │ ├── manual_midpoint.stderr │ ├── manual_next_back.fixed │ ├── manual_next_back.rs │ ├── manual_next_back.stderr │ ├── manual_non_exhaustive_enum.rs │ ├── manual_non_exhaustive_enum.stderr │ ├── manual_non_exhaustive_struct.rs │ ├── manual_non_exhaustive_struct.stderr │ ├── manual_ok_err.fixed │ ├── manual_ok_err.rs │ ├── manual_ok_err.stderr │ ├── manual_ok_or.fixed │ ├── manual_ok_or.rs │ ├── manual_ok_or.stderr │ ├── manual_option_as_slice.fixed │ ├── manual_option_as_slice.rs │ ├── manual_option_as_slice.stderr │ ├── manual_pattern_char_comparison.fixed │ ├── manual_pattern_char_comparison.rs │ ├── manual_pattern_char_comparison.stderr │ ├── manual_range_patterns.fixed │ ├── manual_range_patterns.rs │ ├── manual_range_patterns.stderr │ ├── manual_rem_euclid.fixed │ ├── manual_rem_euclid.rs │ ├── manual_rem_euclid.stderr │ ├── manual_repeat_n.fixed │ ├── manual_repeat_n.rs │ ├── manual_repeat_n.stderr │ ├── manual_retain.fixed │ ├── manual_retain.rs │ ├── manual_retain.stderr │ ├── manual_rotate.fixed │ ├── manual_rotate.rs │ ├── manual_rotate.stderr │ ├── manual_saturating_arithmetic.fixed │ ├── manual_saturating_arithmetic.rs │ ├── manual_saturating_arithmetic.stderr │ ├── manual_slice_fill.fixed │ ├── manual_slice_fill.rs │ ├── manual_slice_fill.stderr │ ├── manual_slice_size_calculation.fixed │ ├── manual_slice_size_calculation.rs │ ├── manual_slice_size_calculation.stderr │ ├── manual_split_once.fixed │ ├── manual_split_once.rs │ ├── manual_split_once.stderr │ ├── manual_str_repeat.fixed │ ├── manual_str_repeat.rs │ ├── manual_str_repeat.stderr │ ├── manual_string_new.fixed │ ├── manual_string_new.rs │ ├── manual_string_new.stderr │ ├── manual_strip.rs │ ├── manual_strip.stderr │ ├── manual_strip_fixable.fixed │ ├── manual_strip_fixable.rs │ ├── manual_strip_fixable.stderr │ ├── manual_swap_auto_fix.fixed │ ├── manual_swap_auto_fix.rs │ ├── manual_swap_auto_fix.stderr │ ├── manual_try_fold.rs │ ├── manual_try_fold.stderr │ ├── manual_unwrap_or.fixed │ ├── manual_unwrap_or.rs │ ├── manual_unwrap_or.stderr │ ├── manual_unwrap_or_default.fixed │ ├── manual_unwrap_or_default.rs │ ├── manual_unwrap_or_default.stderr │ ├── manual_unwrap_or_default_unfixable.rs │ ├── manual_unwrap_or_default_unfixable.stderr │ ├── manual_while_let_some.fixed │ ├── manual_while_let_some.rs │ ├── manual_while_let_some.stderr │ ├── many_single_char_names.rs │ ├── many_single_char_names.stderr │ ├── map_all_any_identity.fixed │ ├── map_all_any_identity.rs │ ├── map_all_any_identity.stderr │ ├── map_clone.fixed │ ├── map_clone.rs │ ├── map_clone.stderr │ ├── map_collect_result_unit.fixed │ ├── map_collect_result_unit.rs │ ├── map_collect_result_unit.stderr │ ├── map_err.rs │ ├── map_err.stderr │ ├── map_flatten.rs │ ├── map_flatten.stderr │ ├── map_flatten_fixable.fixed │ ├── map_flatten_fixable.rs │ ├── map_flatten_fixable.stderr │ ├── map_identity.fixed │ ├── map_identity.rs │ ├── map_identity.stderr │ ├── map_unit_fn.rs │ ├── map_unwrap_or.rs │ ├── map_unwrap_or.stderr │ ├── map_unwrap_or_fixable.fixed │ ├── map_unwrap_or_fixable.rs │ ├── map_unwrap_or_fixable.stderr │ ├── map_with_unused_argument_over_ranges.fixed │ ├── map_with_unused_argument_over_ranges.rs │ ├── map_with_unused_argument_over_ranges.stderr │ ├── map_with_unused_argument_over_ranges_nostd.fixed │ ├── map_with_unused_argument_over_ranges_nostd.rs │ ├── map_with_unused_argument_over_ranges_nostd.stderr │ ├── match_as_ref.fixed │ ├── match_as_ref.rs │ ├── match_as_ref.stderr │ ├── match_bool.fixed │ ├── match_bool.rs │ ├── match_bool.stderr │ ├── match_expr_like_matches_macro.fixed │ ├── match_expr_like_matches_macro.rs │ ├── match_expr_like_matches_macro.stderr │ ├── match_overlapping_arm.rs │ ├── match_overlapping_arm.stderr │ ├── match_ref_pats.fixed │ ├── match_ref_pats.rs │ ├── match_ref_pats.stderr │ ├── match_result_ok.fixed │ ├── match_result_ok.rs │ ├── match_result_ok.stderr │ ├── match_same_arms.fixed │ ├── match_same_arms.rs │ ├── match_same_arms.stderr │ ├── match_same_arms2.fixed │ ├── match_same_arms2.rs │ ├── match_same_arms2.stderr │ ├── match_same_arms_non_exhaustive.fixed │ ├── match_same_arms_non_exhaustive.rs │ ├── match_same_arms_non_exhaustive.stderr │ ├── match_single_binding.fixed │ ├── match_single_binding.rs │ ├── match_single_binding.stderr │ ├── match_single_binding2.fixed │ ├── match_single_binding2.rs │ ├── match_single_binding2.stderr │ ├── match_str_case_mismatch.fixed │ ├── match_str_case_mismatch.rs │ ├── match_str_case_mismatch.stderr │ ├── match_wild_err_arm.rs │ ├── match_wild_err_arm.stderr │ ├── match_wildcard_for_single_variants.fixed │ ├── match_wildcard_for_single_variants.rs │ ├── match_wildcard_for_single_variants.stderr │ ├── mem_forget.rs │ ├── mem_forget.stderr │ ├── mem_replace.fixed │ ├── mem_replace.rs │ ├── mem_replace.stderr │ ├── mem_replace_macro.rs │ ├── mem_replace_macro.stderr │ ├── mem_replace_no_std.fixed │ ├── mem_replace_no_std.rs │ ├── mem_replace_no_std.stderr │ ├── methods.rs │ ├── methods.stderr │ ├── methods_fixable.fixed │ ├── methods_fixable.rs │ ├── methods_fixable.stderr │ ├── methods_unfixable.rs │ ├── methods_unfixable.stderr │ ├── min_ident_chars.rs │ ├── min_ident_chars.stderr │ ├── min_max.rs │ ├── min_max.stderr │ ├── min_rust_version_attr.rs │ ├── min_rust_version_attr.stderr │ ├── min_rust_version_invalid_attr.rs │ ├── min_rust_version_invalid_attr.stderr │ ├── mismatching_type_param_order.rs │ ├── mismatching_type_param_order.stderr │ ├── misnamed_getters.fixed │ ├── misnamed_getters.rs │ ├── misnamed_getters.stderr │ ├── misnamed_getters_2021.fixed │ ├── misnamed_getters_2021.rs │ ├── misnamed_getters_2021.stderr │ ├── misrefactored_assign_op.1.fixed │ ├── misrefactored_assign_op.2.fixed │ ├── misrefactored_assign_op.rs │ ├── misrefactored_assign_op.stderr │ ├── missing_assert_message.rs │ ├── missing_assert_message.stderr │ ├── missing_asserts_for_indexing.fixed │ ├── missing_asserts_for_indexing.rs │ ├── missing_asserts_for_indexing.stderr │ ├── missing_asserts_for_indexing_unfixable.rs │ ├── missing_asserts_for_indexing_unfixable.stderr │ ├── missing_const_for_fn │ │ ├── auxiliary │ │ │ └── helper.rs │ │ ├── cant_be_const.rs │ │ ├── could_be_const.fixed │ │ ├── could_be_const.rs │ │ └── could_be_const.stderr │ ├── missing_const_for_thread_local.fixed │ ├── missing_const_for_thread_local.rs │ ├── missing_const_for_thread_local.stderr │ ├── missing_doc.rs │ ├── missing_doc.stderr │ ├── missing_doc_crate.rs │ ├── missing_doc_crate_missing.rs │ ├── missing_doc_crate_missing.stderr │ ├── missing_doc_impl.rs │ ├── missing_doc_impl.stderr │ ├── missing_fields_in_debug.rs │ ├── missing_fields_in_debug.stderr │ ├── missing_inline.rs │ ├── missing_inline.stderr │ ├── missing_inline_executable.rs │ ├── missing_inline_proc_macro.rs │ ├── missing_panics_doc.rs │ ├── missing_panics_doc.stderr │ ├── missing_spin_loop.fixed │ ├── missing_spin_loop.rs │ ├── missing_spin_loop.stderr │ ├── missing_spin_loop_no_std.fixed │ ├── missing_spin_loop_no_std.rs │ ├── missing_spin_loop_no_std.stderr │ ├── missing_trait_methods.rs │ ├── missing_trait_methods.stderr │ ├── missing_transmute_annotations.fixed │ ├── missing_transmute_annotations.rs │ ├── missing_transmute_annotations.stderr │ ├── mistyped_literal_suffix.fixed │ ├── mistyped_literal_suffix.rs │ ├── mistyped_literal_suffix.stderr │ ├── mixed_attributes_style.rs │ ├── mixed_attributes_style.stderr │ ├── mixed_attributes_style │ │ ├── auxiliary │ │ │ └── submodule.rs │ │ ├── global_allow.rs │ │ ├── mod_declaration.rs │ │ └── mod_declaration.stderr │ ├── mixed_read_write_in_expression.rs │ ├── mixed_read_write_in_expression.stderr │ ├── module_inception.rs │ ├── module_inception.stderr │ ├── module_name_repetitions.rs │ ├── module_name_repetitions.stderr │ ├── modulo_arithmetic_float.rs │ ├── modulo_arithmetic_float.stderr │ ├── modulo_arithmetic_integral.rs │ ├── modulo_arithmetic_integral.stderr │ ├── modulo_arithmetic_integral_const.rs │ ├── modulo_arithmetic_integral_const.stderr │ ├── modulo_one.rs │ ├── modulo_one.stderr │ ├── msrv_attributes_without_early_lints.rs │ ├── multi_assignments.rs │ ├── multi_assignments.stderr │ ├── multiple_bound_locations.rs │ ├── multiple_bound_locations.stderr │ ├── multiple_unsafe_ops_per_block.rs │ ├── multiple_unsafe_ops_per_block.stderr │ ├── must_use_candidates.fixed │ ├── must_use_candidates.rs │ ├── must_use_candidates.stderr │ ├── must_use_unit.fixed │ ├── must_use_unit.rs │ ├── must_use_unit.stderr │ ├── must_use_unit_unfixable.rs │ ├── must_use_unit_unfixable.stderr │ ├── mut_from_ref.rs │ ├── mut_from_ref.stderr │ ├── mut_key.rs │ ├── mut_key.stderr │ ├── mut_mut.rs │ ├── mut_mut.stderr │ ├── mut_mutex_lock.fixed │ ├── mut_mutex_lock.rs │ ├── mut_mutex_lock.stderr │ ├── mut_range_bound.rs │ ├── mut_range_bound.stderr │ ├── mut_reference.rs │ ├── mut_reference.stderr │ ├── mutex_atomic.rs │ ├── mutex_atomic.stderr │ ├── needless_arbitrary_self_type.fixed │ ├── needless_arbitrary_self_type.rs │ ├── needless_arbitrary_self_type.stderr │ ├── needless_arbitrary_self_type_unfixable.fixed │ ├── needless_arbitrary_self_type_unfixable.rs │ ├── needless_arbitrary_self_type_unfixable.stderr │ ├── needless_as_bytes.fixed │ ├── needless_as_bytes.rs │ ├── needless_as_bytes.stderr │ ├── needless_bitwise_bool.fixed │ ├── needless_bitwise_bool.rs │ ├── needless_bitwise_bool.stderr │ ├── needless_bool │ │ ├── fixable.fixed │ │ ├── fixable.rs │ │ ├── fixable.stderr │ │ ├── simple.rs │ │ └── simple.stderr │ ├── needless_bool_assign.fixed │ ├── needless_bool_assign.rs │ ├── needless_bool_assign.stderr │ ├── needless_borrow.fixed │ ├── needless_borrow.rs │ ├── needless_borrow.stderr │ ├── needless_borrow_pat.fixed │ ├── needless_borrow_pat.rs │ ├── needless_borrow_pat.stderr │ ├── needless_borrowed_ref.fixed │ ├── needless_borrowed_ref.rs │ ├── needless_borrowed_ref.stderr │ ├── needless_borrows_for_generic_args.fixed │ ├── needless_borrows_for_generic_args.rs │ ├── needless_borrows_for_generic_args.stderr │ ├── needless_character_iteration.fixed │ ├── needless_character_iteration.rs │ ├── needless_character_iteration.stderr │ ├── needless_collect.fixed │ ├── needless_collect.rs │ ├── needless_collect.stderr │ ├── needless_collect_indirect.rs │ ├── needless_collect_indirect.stderr │ ├── needless_continue.rs │ ├── needless_continue.stderr │ ├── needless_doc_main.rs │ ├── needless_doc_main.stderr │ ├── needless_else.fixed │ ├── needless_else.rs │ ├── needless_else.stderr │ ├── needless_for_each_fixable.fixed │ ├── needless_for_each_fixable.rs │ ├── needless_for_each_fixable.stderr │ ├── needless_for_each_unfixable.rs │ ├── needless_for_each_unfixable.stderr │ ├── needless_if.fixed │ ├── needless_if.rs │ ├── needless_if.stderr │ ├── needless_late_init.fixed │ ├── needless_late_init.rs │ ├── needless_late_init.stderr │ ├── needless_lifetimes.fixed │ ├── needless_lifetimes.rs │ ├── needless_lifetimes.stderr │ ├── needless_match.fixed │ ├── needless_match.rs │ ├── needless_match.stderr │ ├── needless_maybe_sized.fixed │ ├── needless_maybe_sized.rs │ ├── needless_maybe_sized.stderr │ ├── needless_option_as_deref.fixed │ ├── needless_option_as_deref.rs │ ├── needless_option_as_deref.stderr │ ├── needless_option_take.fixed │ ├── needless_option_take.rs │ ├── needless_option_take.stderr │ ├── needless_parens_on_range_literals.fixed │ ├── needless_parens_on_range_literals.rs │ ├── needless_parens_on_range_literals.stderr │ ├── needless_pass_by_ref_mut.rs │ ├── needless_pass_by_ref_mut.stderr │ ├── needless_pass_by_ref_mut2.fixed │ ├── needless_pass_by_ref_mut2.rs │ ├── needless_pass_by_ref_mut2.stderr │ ├── needless_pass_by_ref_mut_2021.rs │ ├── needless_pass_by_value.rs │ ├── needless_pass_by_value.stderr │ ├── needless_pass_by_value_proc_macro.rs │ ├── needless_pub_self.fixed │ ├── needless_pub_self.rs │ ├── needless_pub_self.stderr │ ├── needless_question_mark.fixed │ ├── needless_question_mark.rs │ ├── needless_question_mark.stderr │ ├── needless_range_loop.rs │ ├── needless_range_loop.stderr │ ├── needless_range_loop2.rs │ ├── needless_range_loop2.stderr │ ├── needless_raw_string.fixed │ ├── needless_raw_string.rs │ ├── needless_raw_string.stderr │ ├── needless_raw_string_hashes.fixed │ ├── needless_raw_string_hashes.rs │ ├── needless_raw_string_hashes.stderr │ ├── needless_return.fixed │ ├── needless_return.rs │ ├── needless_return.stderr │ ├── needless_return_with_question_mark.fixed │ ├── needless_return_with_question_mark.rs │ ├── needless_return_with_question_mark.stderr │ ├── needless_splitn.fixed │ ├── needless_splitn.rs │ ├── needless_splitn.stderr │ ├── needless_update.rs │ ├── needless_update.stderr │ ├── neg_cmp_op_on_partial_ord.rs │ ├── neg_cmp_op_on_partial_ord.stderr │ ├── neg_multiply.fixed │ ├── neg_multiply.rs │ ├── neg_multiply.stderr │ ├── never_loop.rs │ ├── never_loop.stderr │ ├── never_loop_fixable.fixed │ ├── never_loop_fixable.rs │ ├── never_loop_fixable.stderr │ ├── new_ret_no_self.rs │ ├── new_ret_no_self.stderr │ ├── new_ret_no_self_overflow.rs │ ├── new_ret_no_self_overflow.stderr │ ├── new_without_default.fixed │ ├── new_without_default.rs │ ├── new_without_default.stderr │ ├── no_effect.rs │ ├── no_effect.stderr │ ├── no_effect_async_fn.rs │ ├── no_effect_async_fn.stderr │ ├── no_effect_replace.rs │ ├── no_effect_replace.stderr │ ├── no_effect_return.rs │ ├── no_effect_return.stderr │ ├── no_mangle_with_rust_abi.rs │ ├── no_mangle_with_rust_abi.stderr │ ├── no_mangle_with_rust_abi_2021.rs │ ├── no_mangle_with_rust_abi_2021.stderr │ ├── non_canonical_clone_impl.fixed │ ├── non_canonical_clone_impl.rs │ ├── non_canonical_clone_impl.stderr │ ├── non_canonical_partial_ord_impl.fixed │ ├── non_canonical_partial_ord_impl.rs │ ├── non_canonical_partial_ord_impl.stderr │ ├── non_canonical_partial_ord_impl_fully_qual.rs │ ├── non_canonical_partial_ord_impl_fully_qual.stderr │ ├── non_expressive_names.rs │ ├── non_expressive_names.stderr │ ├── non_expressive_names_error_recovery.fixed │ ├── non_expressive_names_error_recovery.rs │ ├── non_expressive_names_error_recovery.stderr │ ├── non_minimal_cfg.fixed │ ├── non_minimal_cfg.rs │ ├── non_minimal_cfg.stderr │ ├── non_minimal_cfg2.rs │ ├── non_minimal_cfg2.stderr │ ├── non_octal_unix_permissions.fixed │ ├── non_octal_unix_permissions.rs │ ├── non_octal_unix_permissions.stderr │ ├── non_send_fields_in_send_ty.rs │ ├── non_send_fields_in_send_ty.stderr │ ├── non_std_lazy_static │ │ ├── auxiliary │ │ │ ├── lazy_static.rs │ │ │ └── once_cell.rs │ │ ├── non_std_lazy_static_fixable.fixed │ │ ├── non_std_lazy_static_fixable.rs │ │ ├── non_std_lazy_static_fixable.stderr │ │ ├── non_std_lazy_static_no_std.rs │ │ ├── non_std_lazy_static_other_once_cell.rs │ │ ├── non_std_lazy_static_unfixable.rs │ │ └── non_std_lazy_static_unfixable.stderr │ ├── non_zero_suggestions.fixed │ ├── non_zero_suggestions.rs │ ├── non_zero_suggestions.stderr │ ├── non_zero_suggestions_unfixable.rs │ ├── non_zero_suggestions_unfixable.stderr │ ├── nonminimal_bool.rs │ ├── nonminimal_bool.stderr │ ├── nonminimal_bool_methods.fixed │ ├── nonminimal_bool_methods.rs │ ├── nonminimal_bool_methods.stderr │ ├── nonminimal_bool_methods_unfixable.rs │ ├── nonminimal_bool_methods_unfixable.stderr │ ├── obfuscated_if_else.fixed │ ├── obfuscated_if_else.rs │ ├── obfuscated_if_else.stderr │ ├── octal_escapes.rs │ ├── octal_escapes.stderr │ ├── ok_expect.rs │ ├── ok_expect.stderr │ ├── only_used_in_recursion.rs │ ├── only_used_in_recursion.stderr │ ├── only_used_in_recursion2.rs │ ├── only_used_in_recursion2.stderr │ ├── op_ref.fixed │ ├── op_ref.rs │ ├── op_ref.stderr │ ├── open_options.rs │ ├── open_options.stderr │ ├── open_options_fixable.fixed │ ├── open_options_fixable.rs │ ├── open_options_fixable.stderr │ ├── option_as_ref_cloned.fixed │ ├── option_as_ref_cloned.rs │ ├── option_as_ref_cloned.stderr │ ├── option_as_ref_deref.fixed │ ├── option_as_ref_deref.rs │ ├── option_as_ref_deref.stderr │ ├── option_env_unwrap.rs │ ├── option_env_unwrap.stderr │ ├── option_filter_map.fixed │ ├── option_filter_map.rs │ ├── option_filter_map.stderr │ ├── option_if_let_else.fixed │ ├── option_if_let_else.rs │ ├── option_if_let_else.stderr │ ├── option_map_or_none.fixed │ ├── option_map_or_none.rs │ ├── option_map_or_none.stderr │ ├── option_map_unit_fn_fixable.fixed │ ├── option_map_unit_fn_fixable.rs │ ├── option_map_unit_fn_fixable.stderr │ ├── option_map_unit_fn_unfixable.rs │ ├── option_map_unit_fn_unfixable.stderr │ ├── option_option.rs │ ├── option_option.stderr │ ├── or_fun_call.fixed │ ├── or_fun_call.rs │ ├── or_fun_call.stderr │ ├── or_then_unwrap.fixed │ ├── or_then_unwrap.rs │ ├── or_then_unwrap.stderr │ ├── out_of_bounds_indexing │ │ ├── issue-3102.rs │ │ ├── issue-3102.stderr │ │ ├── simple.rs │ │ └── simple.stderr │ ├── overly_complex_bool_expr.fixed │ ├── overly_complex_bool_expr.rs │ ├── overly_complex_bool_expr.stderr │ ├── owned_cow.fixed │ ├── owned_cow.rs │ ├── owned_cow.stderr │ ├── panic_in_result_fn.rs │ ├── panic_in_result_fn.stderr │ ├── panic_in_result_fn_assertions.rs │ ├── panic_in_result_fn_assertions.stderr │ ├── panic_in_result_fn_debug_assertions.rs │ ├── panicking_macros.rs │ ├── panicking_macros.stderr │ ├── panicking_overflow_checks.rs │ ├── panicking_overflow_checks.stderr │ ├── partial_pub_fields.rs │ ├── partial_pub_fields.stderr │ ├── partialeq_ne_impl.rs │ ├── partialeq_ne_impl.stderr │ ├── partialeq_to_none.fixed │ ├── partialeq_to_none.rs │ ├── partialeq_to_none.stderr │ ├── path_buf_push_overwrite.fixed │ ├── path_buf_push_overwrite.rs │ ├── path_buf_push_overwrite.stderr │ ├── path_ends_with_ext.fixed │ ├── path_ends_with_ext.rs │ ├── path_ends_with_ext.stderr │ ├── pathbuf_init_then_push.fixed │ ├── pathbuf_init_then_push.rs │ ├── pathbuf_init_then_push.stderr │ ├── pattern_type_mismatch │ │ ├── mutability.rs │ │ ├── mutability.stderr │ │ ├── pattern_alternatives.rs │ │ ├── pattern_alternatives.stderr │ │ ├── pattern_structs.rs │ │ ├── pattern_structs.stderr │ │ ├── pattern_tuples.rs │ │ ├── pattern_tuples.stderr │ │ ├── syntax.rs │ │ └── syntax.stderr │ ├── patterns.fixed │ ├── patterns.rs │ ├── patterns.stderr │ ├── permissions_set_readonly_false.rs │ ├── permissions_set_readonly_false.stderr │ ├── pointer_format.rs │ ├── pointer_format.stderr │ ├── pointers_in_nomem_asm_block.rs │ ├── pointers_in_nomem_asm_block.stderr │ ├── precedence.fixed │ ├── precedence.rs │ ├── precedence.stderr │ ├── precedence_bits.fixed │ ├── precedence_bits.rs │ ├── precedence_bits.stderr │ ├── print.rs │ ├── print.stderr │ ├── print_in_format_impl.rs │ ├── print_in_format_impl.stderr │ ├── print_literal.fixed │ ├── print_literal.rs │ ├── print_literal.stderr │ ├── print_stderr.rs │ ├── print_stderr.stderr │ ├── print_stdout_build_script.rs │ ├── print_with_newline.fixed │ ├── print_with_newline.rs │ ├── print_with_newline.stderr │ ├── println_empty_string.fixed │ ├── println_empty_string.rs │ ├── println_empty_string.stderr │ ├── proc_macro.rs │ ├── proc_macro.stderr │ ├── ptr_arg.rs │ ├── ptr_arg.stderr │ ├── ptr_as_ptr.fixed │ ├── ptr_as_ptr.rs │ ├── ptr_as_ptr.stderr │ ├── ptr_cast_constness.fixed │ ├── ptr_cast_constness.rs │ ├── ptr_cast_constness.stderr │ ├── ptr_eq.fixed │ ├── ptr_eq.rs │ ├── ptr_eq.stderr │ ├── ptr_eq_no_std.fixed │ ├── ptr_eq_no_std.rs │ ├── ptr_eq_no_std.stderr │ ├── ptr_offset_with_cast.fixed │ ├── ptr_offset_with_cast.rs │ ├── ptr_offset_with_cast.stderr │ ├── pub_use.rs │ ├── pub_use.stderr │ ├── pub_with_shorthand.fixed │ ├── pub_with_shorthand.rs │ ├── pub_with_shorthand.stderr │ ├── pub_without_shorthand.fixed │ ├── pub_without_shorthand.rs │ ├── pub_without_shorthand.stderr │ ├── question_mark.fixed │ ├── question_mark.rs │ ├── question_mark.stderr │ ├── question_mark_used.rs │ ├── question_mark_used.stderr │ ├── range.fixed │ ├── range.rs │ ├── range.stderr │ ├── range_contains.fixed │ ├── range_contains.rs │ ├── range_contains.stderr │ ├── range_plus_minus_one.fixed │ ├── range_plus_minus_one.rs │ ├── range_plus_minus_one.stderr │ ├── rc_buffer.fixed │ ├── rc_buffer.rs │ ├── rc_buffer.stderr │ ├── rc_buffer_arc.fixed │ ├── rc_buffer_arc.rs │ ├── rc_buffer_arc.stderr │ ├── rc_buffer_redefined_string.rs │ ├── rc_clone_in_vec_init │ │ ├── arc.rs │ │ ├── arc.stderr │ │ ├── rc.rs │ │ ├── rc.stderr │ │ ├── weak.rs │ │ └── weak.stderr │ ├── rc_mutex.rs │ ├── rc_mutex.stderr │ ├── read_line_without_trim.fixed │ ├── read_line_without_trim.rs │ ├── read_line_without_trim.stderr │ ├── read_zero_byte_vec.rs │ ├── read_zero_byte_vec.stderr │ ├── readonly_write_lock.fixed │ ├── readonly_write_lock.rs │ ├── readonly_write_lock.stderr │ ├── recursive_format_impl.rs │ ├── recursive_format_impl.stderr │ ├── redundant_allocation.rs │ ├── redundant_allocation.stderr │ ├── redundant_allocation_fixable.fixed │ ├── redundant_allocation_fixable.rs │ ├── redundant_allocation_fixable.stderr │ ├── redundant_as_str.fixed │ ├── redundant_as_str.rs │ ├── redundant_as_str.stderr │ ├── redundant_async_block.fixed │ ├── redundant_async_block.rs │ ├── redundant_async_block.stderr │ ├── redundant_at_rest_pattern.fixed │ ├── redundant_at_rest_pattern.rs │ ├── redundant_at_rest_pattern.stderr │ ├── redundant_clone.fixed │ ├── redundant_clone.rs │ ├── redundant_clone.stderr │ ├── redundant_closure_call_early.rs │ ├── redundant_closure_call_early.stderr │ ├── redundant_closure_call_fixable.fixed │ ├── redundant_closure_call_fixable.rs │ ├── redundant_closure_call_fixable.stderr │ ├── redundant_closure_call_late.rs │ ├── redundant_closure_call_late.stderr │ ├── redundant_else.fixed │ ├── redundant_else.rs │ ├── redundant_else.stderr │ ├── redundant_field_names.fixed │ ├── redundant_field_names.rs │ ├── redundant_field_names.stderr │ ├── redundant_guards.fixed │ ├── redundant_guards.rs │ ├── redundant_guards.stderr │ ├── redundant_locals.rs │ ├── redundant_locals.stderr │ ├── redundant_pattern_matching_drop_order.fixed │ ├── redundant_pattern_matching_drop_order.rs │ ├── redundant_pattern_matching_drop_order.stderr │ ├── redundant_pattern_matching_if_let_true.fixed │ ├── redundant_pattern_matching_if_let_true.rs │ ├── redundant_pattern_matching_if_let_true.stderr │ ├── redundant_pattern_matching_ipaddr.fixed │ ├── redundant_pattern_matching_ipaddr.rs │ ├── redundant_pattern_matching_ipaddr.stderr │ ├── redundant_pattern_matching_option.fixed │ ├── redundant_pattern_matching_option.rs │ ├── redundant_pattern_matching_option.stderr │ ├── redundant_pattern_matching_poll.fixed │ ├── redundant_pattern_matching_poll.rs │ ├── redundant_pattern_matching_poll.stderr │ ├── redundant_pattern_matching_result.fixed │ ├── redundant_pattern_matching_result.rs │ ├── redundant_pattern_matching_result.stderr │ ├── redundant_pub_crate.fixed │ ├── redundant_pub_crate.rs │ ├── redundant_pub_crate.stderr │ ├── redundant_slicing.fixed │ ├── redundant_slicing.rs │ ├── redundant_slicing.stderr │ ├── redundant_static_lifetimes.fixed │ ├── redundant_static_lifetimes.rs │ ├── redundant_static_lifetimes.stderr │ ├── redundant_static_lifetimes_multiple.rs │ ├── redundant_static_lifetimes_multiple.stderr │ ├── redundant_test_prefix.fixed │ ├── redundant_test_prefix.rs │ ├── redundant_test_prefix.stderr │ ├── redundant_test_prefix_noautofix.rs │ ├── redundant_test_prefix_noautofix.stderr │ ├── redundant_type_annotations.rs │ ├── redundant_type_annotations.stderr │ ├── ref_as_ptr.fixed │ ├── ref_as_ptr.rs │ ├── ref_as_ptr.stderr │ ├── ref_binding_to_reference.rs │ ├── ref_binding_to_reference.stderr │ ├── ref_option │ │ ├── all │ │ │ └── clippy.toml │ │ ├── private │ │ │ └── clippy.toml │ │ ├── ref_option.all.fixed │ │ ├── ref_option.all.stderr │ │ ├── ref_option.private.fixed │ │ ├── ref_option.private.stderr │ │ ├── ref_option.rs │ │ ├── ref_option_traits.all.stderr │ │ ├── ref_option_traits.private.stderr │ │ └── ref_option_traits.rs │ ├── ref_option_ref.rs │ ├── ref_option_ref.stderr │ ├── ref_patterns.rs │ ├── ref_patterns.stderr │ ├── regex.rs │ ├── regex.stderr │ ├── rename.fixed │ ├── rename.rs │ ├── rename.stderr │ ├── renamed_builtin_attr.fixed │ ├── renamed_builtin_attr.rs │ ├── renamed_builtin_attr.stderr │ ├── repeat_once.fixed │ ├── repeat_once.rs │ ├── repeat_once.stderr │ ├── repeat_vec_with_capacity.fixed │ ├── repeat_vec_with_capacity.rs │ ├── repeat_vec_with_capacity.stderr │ ├── repeat_vec_with_capacity_nostd.fixed │ ├── repeat_vec_with_capacity_nostd.rs │ ├── repeat_vec_with_capacity_nostd.stderr │ ├── repl_uninit.rs │ ├── repl_uninit.stderr │ ├── repr_packed_without_abi.rs │ ├── repr_packed_without_abi.stderr │ ├── reserve_after_initialization.fixed │ ├── reserve_after_initialization.rs │ ├── reserve_after_initialization.stderr │ ├── rest_pat_in_fully_bound_structs.rs │ ├── rest_pat_in_fully_bound_structs.stderr │ ├── result_filter_map.fixed │ ├── result_filter_map.rs │ ├── result_filter_map.stderr │ ├── result_large_err.rs │ ├── result_large_err.stderr │ ├── result_map_or_into_option.fixed │ ├── result_map_or_into_option.rs │ ├── result_map_or_into_option.stderr │ ├── result_map_unit_fn_fixable.fixed │ ├── result_map_unit_fn_fixable.rs │ ├── result_map_unit_fn_fixable.stderr │ ├── result_map_unit_fn_unfixable.rs │ ├── result_map_unit_fn_unfixable.stderr │ ├── result_unit_error.rs │ ├── result_unit_error.stderr │ ├── result_unit_error_no_std.rs │ ├── result_unit_error_no_std.stderr │ ├── return_and_then.fixed │ ├── return_and_then.rs │ ├── return_and_then.stderr │ ├── return_self_not_must_use.rs │ ├── return_self_not_must_use.stderr │ ├── reversed_empty_ranges_fixable.fixed │ ├── reversed_empty_ranges_fixable.rs │ ├── reversed_empty_ranges_fixable.stderr │ ├── reversed_empty_ranges_loops_fixable.fixed │ ├── reversed_empty_ranges_loops_fixable.rs │ ├── reversed_empty_ranges_loops_fixable.stderr │ ├── reversed_empty_ranges_loops_unfixable.rs │ ├── reversed_empty_ranges_loops_unfixable.stderr │ ├── reversed_empty_ranges_unfixable.rs │ ├── reversed_empty_ranges_unfixable.stderr │ ├── same_functions_in_if_condition.rs │ ├── same_functions_in_if_condition.stderr │ ├── same_item_push.rs │ ├── same_item_push.stderr │ ├── same_name_method.rs │ ├── same_name_method.stderr │ ├── search_is_some.rs │ ├── search_is_some.stderr │ ├── search_is_some_fixable_none.fixed │ ├── search_is_some_fixable_none.rs │ ├── search_is_some_fixable_none.stderr │ ├── search_is_some_fixable_none_2021.fixed │ ├── search_is_some_fixable_none_2021.rs │ ├── search_is_some_fixable_none_2021.stderr │ ├── search_is_some_fixable_some.fixed │ ├── search_is_some_fixable_some.rs │ ├── search_is_some_fixable_some.stderr │ ├── search_is_some_fixable_some_2021.fixed │ ├── search_is_some_fixable_some_2021.rs │ ├── search_is_some_fixable_some_2021.stderr │ ├── seek_from_current.fixed │ ├── seek_from_current.rs │ ├── seek_from_current.stderr │ ├── seek_to_start_instead_of_rewind.fixed │ ├── seek_to_start_instead_of_rewind.rs │ ├── seek_to_start_instead_of_rewind.stderr │ ├── self_assignment.rs │ ├── self_assignment.stderr │ ├── self_named_constructors.rs │ ├── self_named_constructors.stderr │ ├── semicolon_if_nothing_returned.fixed │ ├── semicolon_if_nothing_returned.rs │ ├── semicolon_if_nothing_returned.stderr │ ├── semicolon_inside_block.fixed │ ├── semicolon_inside_block.rs │ ├── semicolon_inside_block.stderr │ ├── semicolon_outside_block.fixed │ ├── semicolon_outside_block.rs │ ├── semicolon_outside_block.stderr │ ├── serde.rs │ ├── serde.stderr │ ├── set_contains_or_insert.rs │ ├── set_contains_or_insert.stderr │ ├── shadow.rs │ ├── shadow.stderr │ ├── short_circuit_statement.fixed │ ├── short_circuit_statement.rs │ ├── short_circuit_statement.stderr │ ├── should_impl_trait │ │ ├── corner_cases.rs │ │ ├── method_list_1.rs │ │ ├── method_list_1.stderr │ │ ├── method_list_2.rs │ │ └── method_list_2.stderr │ ├── should_panic_without_expect.rs │ ├── should_panic_without_expect.stderr │ ├── significant_drop_in_scrutinee.rs │ ├── significant_drop_in_scrutinee.stderr │ ├── significant_drop_tightening.fixed │ ├── significant_drop_tightening.rs │ ├── significant_drop_tightening.stderr │ ├── similar_names.rs │ ├── similar_names.stderr │ ├── single_call_fn.rs │ ├── single_call_fn.stderr │ ├── single_char_add_str.fixed │ ├── single_char_add_str.rs │ ├── single_char_add_str.stderr │ ├── single_char_lifetime_names.rs │ ├── single_char_lifetime_names.stderr │ ├── single_char_pattern.fixed │ ├── single_char_pattern.rs │ ├── single_char_pattern.stderr │ ├── single_component_path_imports.fixed │ ├── single_component_path_imports.rs │ ├── single_component_path_imports.stderr │ ├── single_component_path_imports_macro.rs │ ├── single_component_path_imports_nested_first.rs │ ├── single_component_path_imports_nested_first.stderr │ ├── single_component_path_imports_self_after.rs │ ├── single_component_path_imports_self_before.rs │ ├── single_element_loop.fixed │ ├── single_element_loop.rs │ ├── single_element_loop.stderr │ ├── single_match.fixed │ ├── single_match.rs │ ├── single_match.stderr │ ├── single_match_else.fixed │ ├── single_match_else.rs │ ├── single_match_else.stderr │ ├── single_option_map.rs │ ├── single_option_map.stderr │ ├── single_range_in_vec_init.rs │ ├── single_range_in_vec_init.stderr │ ├── size_of_in_element_count │ │ ├── expressions.rs │ │ ├── expressions.stderr │ │ ├── functions.rs │ │ └── functions.stderr │ ├── size_of_ref.rs │ ├── size_of_ref.stderr │ ├── skip_while_next.rs │ ├── skip_while_next.stderr │ ├── sliced_string_as_bytes.fixed │ ├── sliced_string_as_bytes.rs │ ├── sliced_string_as_bytes.stderr │ ├── slow_vector_initialization.fixed │ ├── slow_vector_initialization.rs │ ├── slow_vector_initialization.stderr │ ├── stable_sort_primitive.fixed │ ├── stable_sort_primitive.rs │ ├── stable_sort_primitive.stderr │ ├── starts_ends_with.fixed │ ├── starts_ends_with.rs │ ├── starts_ends_with.stderr │ ├── std_instead_of_core.fixed │ ├── std_instead_of_core.rs │ ├── std_instead_of_core.stderr │ ├── str_split.fixed │ ├── str_split.rs │ ├── str_split.stderr │ ├── str_to_string.fixed │ ├── str_to_string.rs │ ├── str_to_string.stderr │ ├── string_add.rs │ ├── string_add.stderr │ ├── string_add_assign.fixed │ ├── string_add_assign.rs │ ├── string_add_assign.stderr │ ├── string_extend.fixed │ ├── string_extend.rs │ ├── string_extend.stderr │ ├── string_from_utf8_as_bytes.fixed │ ├── string_from_utf8_as_bytes.rs │ ├── string_from_utf8_as_bytes.stderr │ ├── string_lit_as_bytes.fixed │ ├── string_lit_as_bytes.rs │ ├── string_lit_as_bytes.stderr │ ├── string_lit_chars_any.fixed │ ├── string_lit_chars_any.rs │ ├── string_lit_chars_any.stderr │ ├── string_slice.rs │ ├── string_slice.stderr │ ├── string_to_string.rs │ ├── string_to_string.stderr │ ├── string_to_string_in_map.fixed │ ├── string_to_string_in_map.rs │ ├── string_to_string_in_map.stderr │ ├── strlen_on_c_strings.fixed │ ├── strlen_on_c_strings.rs │ ├── strlen_on_c_strings.stderr │ ├── struct_excessive_bools.rs │ ├── struct_excessive_bools.stderr │ ├── struct_fields.rs │ ├── struct_fields.stderr │ ├── suspicious_arithmetic_impl.rs │ ├── suspicious_arithmetic_impl.stderr │ ├── suspicious_command_arg_space.fixed │ ├── suspicious_command_arg_space.rs │ ├── suspicious_command_arg_space.stderr │ ├── suspicious_doc_comments.fixed │ ├── suspicious_doc_comments.rs │ ├── suspicious_doc_comments.stderr │ ├── suspicious_doc_comments_unfixable.rs │ ├── suspicious_doc_comments_unfixable.stderr │ ├── suspicious_else_formatting.rs │ ├── suspicious_else_formatting.stderr │ ├── suspicious_map.rs │ ├── suspicious_map.stderr │ ├── suspicious_operation_groupings.fixed │ ├── suspicious_operation_groupings.rs │ ├── suspicious_operation_groupings.stderr │ ├── suspicious_splitn.rs │ ├── suspicious_splitn.stderr │ ├── suspicious_to_owned.rs │ ├── suspicious_to_owned.stderr │ ├── suspicious_unary_op_formatting.rs │ ├── suspicious_unary_op_formatting.stderr │ ├── suspicious_xor_used_as_pow.rs │ ├── suspicious_xor_used_as_pow.stderr │ ├── swap.fixed │ ├── swap.rs │ ├── swap.stderr │ ├── swap_ptr_to_ref.fixed │ ├── swap_ptr_to_ref.rs │ ├── swap_ptr_to_ref.stderr │ ├── swap_ptr_to_ref_unfixable.rs │ ├── swap_ptr_to_ref_unfixable.stderr │ ├── swap_with_temporary.fixed │ ├── swap_with_temporary.rs │ ├── swap_with_temporary.stderr │ ├── swap_with_temporary_unfixable.rs │ ├── swap_with_temporary_unfixable.stderr │ ├── tabs_in_doc_comments.fixed │ ├── tabs_in_doc_comments.rs │ ├── tabs_in_doc_comments.stderr │ ├── temporary_assignment.rs │ ├── temporary_assignment.stderr │ ├── test_attr_in_doctest.rs │ ├── test_attr_in_doctest.stderr │ ├── tests_outside_test_module.rs │ ├── tests_outside_test_module.stderr │ ├── to_digit_is_some.fixed │ ├── to_digit_is_some.rs │ ├── to_digit_is_some.stderr │ ├── to_string_in_format_args_incremental.fixed │ ├── to_string_in_format_args_incremental.rs │ ├── to_string_in_format_args_incremental.stderr │ ├── to_string_trait_impl.rs │ ├── to_string_trait_impl.stderr │ ├── too_long_first_doc_paragraph-fix.fixed │ ├── too_long_first_doc_paragraph-fix.rs │ ├── too_long_first_doc_paragraph-fix.stderr │ ├── too_long_first_doc_paragraph.rs │ ├── too_long_first_doc_paragraph.stderr │ ├── toplevel_ref_arg.fixed │ ├── toplevel_ref_arg.rs │ ├── toplevel_ref_arg.stderr │ ├── toplevel_ref_arg_non_rustfix.rs │ ├── toplevel_ref_arg_non_rustfix.stderr │ ├── track-diagnostics.rs │ ├── track-diagnostics.stderr │ ├── trailing_empty_array.rs │ ├── trailing_empty_array.stderr │ ├── trailing_zeros.fixed │ ├── trailing_zeros.rs │ ├── trailing_zeros.stderr │ ├── trait_duplication_in_bounds.fixed │ ├── trait_duplication_in_bounds.rs │ ├── trait_duplication_in_bounds.stderr │ ├── trait_duplication_in_bounds_unfixable.rs │ ├── trait_duplication_in_bounds_unfixable.stderr │ ├── transmute.rs │ ├── transmute.stderr │ ├── transmute_32bit.rs │ ├── transmute_32bit.stderr │ ├── transmute_64bit.rs │ ├── transmute_64bit.stderr │ ├── transmute_collection.rs │ ├── transmute_collection.stderr │ ├── transmute_int_to_non_zero.fixed │ ├── transmute_int_to_non_zero.rs │ ├── transmute_int_to_non_zero.stderr │ ├── transmute_null_to_fn.rs │ ├── transmute_null_to_fn.stderr │ ├── transmute_ptr_to_ptr.fixed │ ├── transmute_ptr_to_ptr.rs │ ├── transmute_ptr_to_ptr.stderr │ ├── transmute_ptr_to_ref.fixed │ ├── transmute_ptr_to_ref.rs │ ├── transmute_ptr_to_ref.stderr │ ├── transmute_ref_to_ref.rs │ ├── transmute_ref_to_ref.stderr │ ├── transmute_ref_to_ref_no_std.rs │ ├── transmute_ref_to_ref_no_std.stderr │ ├── transmute_undefined_repr.rs │ ├── transmute_undefined_repr.stderr │ ├── transmutes_expressible_as_ptr_casts.fixed │ ├── transmutes_expressible_as_ptr_casts.rs │ ├── transmutes_expressible_as_ptr_casts.stderr │ ├── transmuting_null.rs │ ├── transmuting_null.stderr │ ├── trim_split_whitespace.fixed │ ├── trim_split_whitespace.rs │ ├── trim_split_whitespace.stderr │ ├── trivially_copy_pass_by_ref.fixed │ ├── trivially_copy_pass_by_ref.rs │ ├── trivially_copy_pass_by_ref.stderr │ ├── try_err.fixed │ ├── try_err.rs │ ├── try_err.stderr │ ├── tuple_array_conversions.rs │ ├── tuple_array_conversions.stderr │ ├── ty_fn_sig.rs │ ├── type_complexity.rs │ ├── type_complexity.stderr │ ├── type_id_on_box.fixed │ ├── type_id_on_box.rs │ ├── type_id_on_box.stderr │ ├── type_id_on_box_unfixable.rs │ ├── type_id_on_box_unfixable.stderr │ ├── type_repetition_in_bounds.rs │ ├── type_repetition_in_bounds.stderr │ ├── unbuffered_bytes.rs │ ├── unbuffered_bytes.stderr │ ├── unchecked_duration_subtraction.fixed │ ├── unchecked_duration_subtraction.rs │ ├── unchecked_duration_subtraction.stderr │ ├── unconditional_recursion.rs │ ├── unconditional_recursion.stderr │ ├── unicode.fixed │ ├── unicode.rs │ ├── unicode.stderr │ ├── uninhabited_references.rs │ ├── uninhabited_references.stderr │ ├── uninit.rs │ ├── uninit.stderr │ ├── uninit_vec.rs │ ├── uninit_vec.stderr │ ├── uninlined_format_args.fixed │ ├── uninlined_format_args.rs │ ├── uninlined_format_args.stderr │ ├── uninlined_format_args_panic.edition2018.fixed │ ├── uninlined_format_args_panic.edition2018.stderr │ ├── uninlined_format_args_panic.edition2021.fixed │ ├── uninlined_format_args_panic.edition2021.stderr │ ├── uninlined_format_args_panic.rs │ ├── unit_arg.rs │ ├── unit_arg.stderr │ ├── unit_arg_empty_blocks.fixed │ ├── unit_arg_empty_blocks.rs │ ├── unit_arg_empty_blocks.stderr │ ├── unit_cmp.rs │ ├── unit_cmp.stderr │ ├── unit_hash.fixed │ ├── unit_hash.rs │ ├── unit_hash.stderr │ ├── unit_return_expecting_ord.rs │ ├── unit_return_expecting_ord.stderr │ ├── unknown_attribute.rs │ ├── unknown_attribute.stderr │ ├── unknown_clippy_lints.fixed │ ├── unknown_clippy_lints.rs │ ├── unknown_clippy_lints.stderr │ ├── unnecessary_box_returns.rs │ ├── unnecessary_box_returns.stderr │ ├── unnecessary_cast.fixed │ ├── unnecessary_cast.rs │ ├── unnecessary_cast.stderr │ ├── unnecessary_cast_unfixable.rs │ ├── unnecessary_cast_unfixable.stderr │ ├── unnecessary_clippy_cfg.rs │ ├── unnecessary_clippy_cfg.stderr │ ├── unnecessary_clone.rs │ ├── unnecessary_clone.stderr │ ├── unnecessary_fallible_conversions.fixed │ ├── unnecessary_fallible_conversions.rs │ ├── unnecessary_fallible_conversions.stderr │ ├── unnecessary_fallible_conversions_unfixable.rs │ ├── unnecessary_fallible_conversions_unfixable.stderr │ ├── unnecessary_filter_map.rs │ ├── unnecessary_filter_map.stderr │ ├── unnecessary_find_map.rs │ ├── unnecessary_find_map.stderr │ ├── unnecessary_first_then_check.fixed │ ├── unnecessary_first_then_check.rs │ ├── unnecessary_first_then_check.stderr │ ├── unnecessary_fold.fixed │ ├── unnecessary_fold.rs │ ├── unnecessary_fold.stderr │ ├── unnecessary_get_then_check.fixed │ ├── unnecessary_get_then_check.rs │ ├── unnecessary_get_then_check.stderr │ ├── unnecessary_iter_cloned.fixed │ ├── unnecessary_iter_cloned.rs │ ├── unnecessary_iter_cloned.stderr │ ├── unnecessary_join.fixed │ ├── unnecessary_join.rs │ ├── unnecessary_join.stderr │ ├── unnecessary_lazy_eval.fixed │ ├── unnecessary_lazy_eval.rs │ ├── unnecessary_lazy_eval.stderr │ ├── unnecessary_lazy_eval_unfixable.rs │ ├── unnecessary_lazy_eval_unfixable.stderr │ ├── unnecessary_literal_bound.fixed │ ├── unnecessary_literal_bound.rs │ ├── unnecessary_literal_bound.stderr │ ├── unnecessary_literal_unwrap.fixed │ ├── unnecessary_literal_unwrap.rs │ ├── unnecessary_literal_unwrap.stderr │ ├── unnecessary_literal_unwrap_unfixable.rs │ ├── unnecessary_literal_unwrap_unfixable.stderr │ ├── unnecessary_map_on_constructor.fixed │ ├── unnecessary_map_on_constructor.rs │ ├── unnecessary_map_on_constructor.stderr │ ├── unnecessary_map_or.fixed │ ├── unnecessary_map_or.rs │ ├── unnecessary_map_or.stderr │ ├── unnecessary_min_or_max.fixed │ ├── unnecessary_min_or_max.rs │ ├── unnecessary_min_or_max.stderr │ ├── unnecessary_operation.fixed │ ├── unnecessary_operation.rs │ ├── unnecessary_operation.stderr │ ├── unnecessary_os_str_debug_formatting.rs │ ├── unnecessary_os_str_debug_formatting.stderr │ ├── unnecessary_owned_empty_strings.fixed │ ├── unnecessary_owned_empty_strings.rs │ ├── unnecessary_owned_empty_strings.stderr │ ├── unnecessary_path_debug_formatting.rs │ ├── unnecessary_path_debug_formatting.stderr │ ├── unnecessary_result_map_or_else.fixed │ ├── unnecessary_result_map_or_else.rs │ ├── unnecessary_result_map_or_else.stderr │ ├── unnecessary_safety_comment.rs │ ├── unnecessary_safety_comment.stderr │ ├── unnecessary_self_imports.fixed │ ├── unnecessary_self_imports.rs │ ├── unnecessary_self_imports.stderr │ ├── unnecessary_semicolon.edition2021.fixed │ ├── unnecessary_semicolon.edition2021.stderr │ ├── unnecessary_semicolon.edition2024.fixed │ ├── unnecessary_semicolon.edition2024.stderr │ ├── unnecessary_semicolon.fixed │ ├── unnecessary_semicolon.rs │ ├── unnecessary_semicolon.stderr │ ├── unnecessary_sort_by.fixed │ ├── unnecessary_sort_by.rs │ ├── unnecessary_sort_by.stderr │ ├── unnecessary_sort_by_no_std.fixed │ ├── unnecessary_sort_by_no_std.rs │ ├── unnecessary_sort_by_no_std.stderr │ ├── unnecessary_struct_initialization.fixed │ ├── unnecessary_struct_initialization.rs │ ├── unnecessary_struct_initialization.stderr │ ├── unnecessary_to_owned.fixed │ ├── unnecessary_to_owned.rs │ ├── unnecessary_to_owned.stderr │ ├── unnecessary_to_owned_on_split.fixed │ ├── unnecessary_to_owned_on_split.rs │ ├── unnecessary_to_owned_on_split.stderr │ ├── unnecessary_unsafety_doc.rs │ ├── unnecessary_unsafety_doc.stderr │ ├── unnecessary_wraps.rs │ ├── unnecessary_wraps.stderr │ ├── unneeded_field_pattern.rs │ ├── unneeded_field_pattern.stderr │ ├── unneeded_struct_pattern.fixed │ ├── unneeded_struct_pattern.rs │ ├── unneeded_struct_pattern.stderr │ ├── unneeded_wildcard_pattern.fixed │ ├── unneeded_wildcard_pattern.rs │ ├── unneeded_wildcard_pattern.stderr │ ├── unnested_or_patterns.fixed │ ├── unnested_or_patterns.rs │ ├── unnested_or_patterns.stderr │ ├── unnested_or_patterns2.fixed │ ├── unnested_or_patterns2.rs │ ├── unnested_or_patterns2.stderr │ ├── unreadable_literal.fixed │ ├── unreadable_literal.rs │ ├── unreadable_literal.stderr │ ├── unsafe_derive_deserialize.rs │ ├── unsafe_derive_deserialize.stderr │ ├── unsafe_removed_from_name.rs │ ├── unsafe_removed_from_name.stderr │ ├── unseparated_prefix_literals.fixed │ ├── unseparated_prefix_literals.rs │ ├── unseparated_prefix_literals.stderr │ ├── unused_async.rs │ ├── unused_async.stderr │ ├── unused_enumerate_index.fixed │ ├── unused_enumerate_index.rs │ ├── unused_enumerate_index.stderr │ ├── unused_format_specs.1.fixed │ ├── unused_format_specs.2.fixed │ ├── unused_format_specs.rs │ ├── unused_format_specs.stderr │ ├── unused_io_amount.rs │ ├── unused_io_amount.stderr │ ├── unused_peekable.rs │ ├── unused_peekable.stderr │ ├── unused_result_ok.fixed │ ├── unused_result_ok.rs │ ├── unused_result_ok.stderr │ ├── unused_rounding.fixed │ ├── unused_rounding.rs │ ├── unused_rounding.stderr │ ├── unused_self.rs │ ├── unused_self.stderr │ ├── unused_trait_names.fixed │ ├── unused_trait_names.rs │ ├── unused_trait_names.stderr │ ├── unused_unit.edition2021.fixed │ ├── unused_unit.edition2021.stderr │ ├── unused_unit.edition2024.fixed │ ├── unused_unit.edition2024.stderr │ ├── unused_unit.fixed │ ├── unused_unit.rs │ ├── unused_unit.stderr │ ├── unwrap.rs │ ├── unwrap.stderr │ ├── unwrap_expect_used.rs │ ├── unwrap_expect_used.stderr │ ├── unwrap_in_result.rs │ ├── unwrap_in_result.stderr │ ├── unwrap_or.fixed │ ├── unwrap_or.rs │ ├── unwrap_or.stderr │ ├── unwrap_or_else_default.fixed │ ├── unwrap_or_else_default.rs │ ├── unwrap_or_else_default.stderr │ ├── update-all-references.sh │ ├── upper_case_acronyms.fixed │ ├── upper_case_acronyms.rs │ ├── upper_case_acronyms.stderr │ ├── use_self.fixed │ ├── use_self.rs │ ├── use_self.stderr │ ├── use_self_trait.fixed │ ├── use_self_trait.rs │ ├── use_self_trait.stderr │ ├── used_underscore_binding.rs │ ├── used_underscore_binding.stderr │ ├── used_underscore_items.rs │ ├── used_underscore_items.stderr │ ├── useful_asref.rs │ ├── useless_asref.fixed │ ├── useless_asref.rs │ ├── useless_asref.stderr │ ├── useless_attribute.fixed │ ├── useless_attribute.rs │ ├── useless_attribute.stderr │ ├── useless_concat.fixed │ ├── useless_concat.rs │ ├── useless_concat.stderr │ ├── useless_conversion.fixed │ ├── useless_conversion.rs │ ├── useless_conversion.stderr │ ├── useless_conversion_try.rs │ ├── useless_conversion_try.stderr │ ├── useless_nonzero_new_unchecked.fixed │ ├── useless_nonzero_new_unchecked.rs │ ├── useless_nonzero_new_unchecked.stderr │ ├── useless_vec.rs │ ├── useless_vec.stderr │ ├── vec.fixed │ ├── vec.rs │ ├── vec.stderr │ ├── vec_box_sized.rs │ ├── vec_box_sized.stderr │ ├── vec_init_then_push.rs │ ├── vec_init_then_push.stderr │ ├── vec_resize_to_zero.fixed │ ├── vec_resize_to_zero.rs │ ├── vec_resize_to_zero.stderr │ ├── verbose_file_reads.rs │ ├── verbose_file_reads.stderr │ ├── waker_clone_wake.fixed │ ├── waker_clone_wake.rs │ ├── waker_clone_wake.stderr │ ├── while_float.rs │ ├── while_float.stderr │ ├── while_let_loop.rs │ ├── while_let_loop.stderr │ ├── while_let_on_iterator.fixed │ ├── while_let_on_iterator.rs │ ├── while_let_on_iterator.stderr │ ├── wild_in_or_pats.rs │ ├── wild_in_or_pats.stderr │ ├── wildcard_enum_match_arm.fixed │ ├── wildcard_enum_match_arm.rs │ ├── wildcard_enum_match_arm.stderr │ ├── wildcard_imports.fixed │ ├── wildcard_imports.rs │ ├── wildcard_imports.stderr │ ├── wildcard_imports_2021.edition2018.fixed │ ├── wildcard_imports_2021.edition2018.stderr │ ├── wildcard_imports_2021.edition2021.fixed │ ├── wildcard_imports_2021.edition2021.stderr │ ├── wildcard_imports_2021.rs │ ├── wildcard_imports_cfgtest.rs │ ├── write_literal.fixed │ ├── write_literal.rs │ ├── write_literal.stderr │ ├── write_literal_2.rs │ ├── write_literal_2.stderr │ ├── write_with_newline.fixed │ ├── write_with_newline.rs │ ├── write_with_newline.stderr │ ├── writeln_empty_string.fixed │ ├── writeln_empty_string.rs │ ├── writeln_empty_string.stderr │ ├── wrong_self_convention.rs │ ├── wrong_self_convention.stderr │ ├── wrong_self_convention2.rs │ ├── wrong_self_convention2.stderr │ ├── wrong_self_conventions_mut.rs │ ├── wrong_self_conventions_mut.stderr │ ├── zero_div_zero.rs │ ├── zero_div_zero.stderr │ ├── zero_offset.rs │ ├── zero_offset.stderr │ ├── zero_ptr.fixed │ ├── zero_ptr.rs │ ├── zero_ptr.stderr │ ├── zero_ptr_no_std.fixed │ ├── zero_ptr_no_std.rs │ ├── zero_ptr_no_std.stderr │ ├── zero_repeat_side_effects.fixed │ ├── zero_repeat_side_effects.rs │ ├── zero_repeat_side_effects.stderr │ ├── zero_sized_btreemap_values.rs │ ├── zero_sized_btreemap_values.stderr │ ├── zero_sized_hashmap_values.rs │ ├── zero_sized_hashmap_values.stderr │ ├── zombie_processes.rs │ ├── zombie_processes.stderr │ ├── zombie_processes_fixable.fixed │ ├── zombie_processes_fixable.rs │ ├── zombie_processes_fixable.stderr │ └── {literal_string_with_formatting_args}.rs ├── versioncheck.rs ├── workspace.rs └── workspace_test │ ├── Cargo.toml │ ├── build.rs │ ├── module_style │ ├── pass_mod_with_dep_in_subdir │ │ ├── Cargo.toml │ │ ├── dep_no_mod │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ │ ├── foo.rs │ │ │ │ ├── foo │ │ │ │ └── hello.rs │ │ │ │ └── lib.rs │ │ └── src │ │ │ ├── bad │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ └── more │ │ │ ├── foo.rs │ │ │ ├── inner │ │ │ └── mod.rs │ │ │ └── mod.rs │ └── pass_no_mod_with_dep_in_subdir │ │ ├── Cargo.toml │ │ ├── dep_with_mod │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ └── with_mod │ │ │ ├── inner.rs │ │ │ ├── inner │ │ │ ├── stuff.rs │ │ │ └── stuff │ │ │ │ └── most.rs │ │ │ └── mod.rs │ │ └── src │ │ ├── good.rs │ │ └── main.rs │ ├── path_dep │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── src │ └── main.rs │ └── subcrate │ ├── Cargo.toml │ └── src │ └── lib.rs ├── triagebot.toml └── util ├── etc ├── pre-commit.sh └── vscode-tasks.json ├── fetch_prs_between.sh ├── gh-pages ├── index_template.html ├── script.js ├── style.css ├── theme.js └── versions.html └── versions.py /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.rs text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4 3 | *.fixed linguist-language=Rust 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Rust Programming Language Forum 4 | url: https://users.rust-lang.org 5 | about: Please ask and answer questions about Rust here. 6 | -------------------------------------------------------------------------------- /.remarkrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "remark-preset-lint-recommended", 4 | "remark-gfm", 5 | ["remark-lint-list-item-indent", false], 6 | ["remark-lint-no-literal-urls", false], 7 | ["remark-lint-no-shortcut-reference-link", false], 8 | ["remark-lint-maximum-line-length", 120] 9 | ], 10 | "settings": { 11 | "commonmark": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # The Rust Code of Conduct 2 | 3 | The Code of Conduct for this repository [can be found online](https://www.rust-lang.org/conduct.html). 4 | -------------------------------------------------------------------------------- /askama.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | dirs = ["util/gh-pages/"] 3 | whitespace = "suppress" 4 | -------------------------------------------------------------------------------- /book/README.md: -------------------------------------------------------------------------------- 1 | # Clippy Book 2 | 3 | This is the source for the Clippy Book. See the 4 | [book](src/development/infrastructure/book.md) for more information. 5 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // Forward the profile to the main compilation 3 | println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap()); 4 | // Don't rebuild even if nothing changed 5 | println!("cargo:rerun-if-changed=build.rs"); 6 | rustc_tools_util::setup_version_info!(); 7 | } 8 | -------------------------------------------------------------------------------- /clippy_dummy/PUBLISH.md: -------------------------------------------------------------------------------- 1 | This is a dummy crate to publish to crates.io. It primarily exists to ensure 2 | that folks trying to install Clippy from crates.io get redirected to the 3 | `rustup` technique. 4 | 5 | Before publishing, be sure to rename `clippy_dummy` to `clippy` in `Cargo.toml`, 6 | it has a different name to avoid workspace issues. 7 | -------------------------------------------------------------------------------- /clippy_dummy/crates-readme.md: -------------------------------------------------------------------------------- 1 | Installing Clippy via crates.io is deprecated. Please use the following: 2 | 3 | ```terminal 4 | rustup component add clippy 5 | ``` 6 | 7 | on a Rust version 1.29 or later. You may need to run `rustup self update` if it complains about a missing Clippy binary. 8 | 9 | See [the homepage](https://github.com/rust-lang/rust-clippy/#clippy) for more information 10 | -------------------------------------------------------------------------------- /clippy_dummy/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | panic!("This shouldn't even compile") 3 | } 4 | -------------------------------------------------------------------------------- /clippy_lints/README.md: -------------------------------------------------------------------------------- 1 | This crate contains Clippy lints. For the main crate, check [GitHub](https://github.com/rust-lang/rust-clippy). 2 | -------------------------------------------------------------------------------- /clippy_lints/src/methods/chars_next_cmp.rs: -------------------------------------------------------------------------------- 1 | use clippy_utils::sym; 2 | use rustc_lint::LateContext; 3 | 4 | use super::CHARS_NEXT_CMP; 5 | 6 | /// Checks for the `CHARS_NEXT_CMP` lint. 7 | pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool { 8 | crate::methods::chars_cmp::check(cx, info, &[sym::chars, sym::next], CHARS_NEXT_CMP, "starts_with") 9 | } 10 | -------------------------------------------------------------------------------- /clippy_lints/src/unit_types/utils.rs: -------------------------------------------------------------------------------- 1 | use rustc_hir::{Expr, ExprKind}; 2 | 3 | pub(super) fn is_unit_literal(expr: &Expr<'_>) -> bool { 4 | matches!(expr.kind, ExprKind::Tup(slice) if slice.is_empty()) 5 | } 6 | -------------------------------------------------------------------------------- /clippy_lints/src/utils/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod attr_collector; 2 | pub mod author; 3 | pub mod dump_hir; 4 | pub mod format_args_collector; 5 | -------------------------------------------------------------------------------- /clippy_lints_internal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "clippy_lints_internal" 3 | version = "0.0.1" 4 | edition = "2024" 5 | 6 | [dependencies] 7 | clippy_config = { path = "../clippy_config" } 8 | clippy_utils = { path = "../clippy_utils" } 9 | regex = { version = "1.5" } 10 | rustc-semver = "1.1" 11 | 12 | [package.metadata.rust-analyzer] 13 | # This crate uses #[feature(rustc_private)] 14 | rustc_private = true 15 | -------------------------------------------------------------------------------- /lintcheck/ci-config/clippy.toml: -------------------------------------------------------------------------------- 1 | # Configuration applied when running lintcheck from the CI 2 | # 3 | # The CI will set the `CLIPPY_CONF_DIR` environment variable 4 | # to `$PWD/lintcheck/ci-config`. 5 | 6 | avoid-breaking-exported-api = false 7 | lint-commented-code = false 8 | -------------------------------------------------------------------------------- /lintcheck/test_sources.toml: -------------------------------------------------------------------------------- 1 | [crates] 2 | cc = {name = "cc", versions = ['1.0.67']} 3 | home = {name = "home", git_url = "https://github.com/brson/home", git_hash = "32044e53dfbdcd32bafad3109d1fbab805fc0f40"} 4 | rustc_tools_util = {name = "rustc_tools_util", versions = ['0.2.0']} 5 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | # begin autogenerated nightly 3 | channel = "nightly-2025-05-31" 4 | # end autogenerated nightly 5 | components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] 6 | profile = "minimal" 7 | -------------------------------------------------------------------------------- /rustc_tools_util/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../LICENSE-APACHE -------------------------------------------------------------------------------- /rustc_tools_util/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../LICENSE-MIT -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 120 2 | comment_width = 100 3 | match_block_trailing_comma = true 4 | wrap_comments = true 5 | edition = "2024" 6 | error_on_line_overflow = true 7 | imports_granularity = "Module" 8 | style_edition = "2024" 9 | ignore = [ 10 | "tests/ui/crashes/ice-9405.rs", 11 | "tests/ui/crashes/ice-10912.rs", 12 | "tests/ui/non_expressive_names_error_recovery.rs", 13 | ] 14 | -------------------------------------------------------------------------------- /tests/clippy.toml: -------------------------------------------------------------------------------- 1 | # default config for tests, overrides clippy.toml at the project root 2 | lint-commented-code = false 3 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_fail" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail/clippy.toml: -------------------------------------------------------------------------------- 1 | cargo-ignore-publish = true 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail_publish/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_fail_publish" 3 | version = "0.1.0" 4 | publish = ["some-registry-name"] 5 | 6 | [workspace] 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail_publish/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_fail_publish_true" 3 | version = "0.1.0" 4 | publish = true 5 | 6 | [workspace] 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/fail_publish_true/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_pass" 3 | version = "0.1.0" 4 | publish = false 5 | description = "A test package for the cargo_common_metadata lint" 6 | repository = "https://github.com/someone/cargo_common_metadata" 7 | readme = "README.md" 8 | license = "MIT OR Apache-2.0" 9 | keywords = ["metadata", "lint", "clippy"] 10 | categories = ["development-tools::testing"] 11 | 12 | [workspace] 13 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass/clippy.toml: -------------------------------------------------------------------------------- 1 | cargo-ignore-publish = true 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass_publish_empty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_pass_publish_empty" 3 | version = "0.1.0" 4 | publish = [] 5 | 6 | [workspace] 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass_publish_empty/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass_publish_false/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo_common_metadata_pass_publish_false" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_common_metadata/pass_publish_false/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::cargo_common_metadata)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-both-diff" 3 | version = "0.1.0" 4 | rust-version = "1.56" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_diff/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.59" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-both-same" 3 | version = "0.1.0" 4 | rust-version = "1.57.0" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_same/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.57" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-cargo" 3 | version = "0.1.0" 4 | rust-version = "1.56.1" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-clippy" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_clippy/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.58" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-file-attr" 3 | version = "0.1.0" 4 | rust-version = "1.13" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_file_attr/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.13.0" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.rs: -------------------------------------------------------------------------------- 1 | // FIXME: this should produce a warning, because the attribute says 1.58 and the cargo.toml file 2 | // says 1.13 3 | 4 | #![feature(custom_inner_attributes)] 5 | #![clippy::msrv = "1.58.0"] 6 | #![deny(clippy::use_self)] 7 | 8 | pub struct Foo; 9 | 10 | impl Foo { 11 | pub fn bar() -> Foo { 12 | Foo 13 | } 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_both_same/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-both-same" 3 | version = "0.1.0" 4 | rust-version = "1.13.0" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_both_same/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.13" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_both_same/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-cargo" 3 | version = "0.1.0" 4 | rust-version = "1.13.0" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_cargo/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-clippy" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_clippy/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.13" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_clippy/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_file_attr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-file-attr" 3 | version = "0.1.0" 4 | rust-version = "1.59" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/pass_file_attr/src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(custom_inner_attributes)] 2 | #![clippy::msrv = "1.13.0"] 3 | #![deny(clippy::use_self)] 4 | 5 | pub struct Foo; 6 | 7 | impl Foo { 8 | pub fn bar() -> Foo { 9 | Foo 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.stderr: -------------------------------------------------------------------------------- 1 | warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.13.0` from `clippy.toml` 2 | 3 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "warn-both-diff" 3 | version = "0.1.0" 4 | rust-version = "1.56.0" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/warn_both_diff/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.13" 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::use_self)] 2 | 3 | pub struct Foo; 4 | 5 | impl Foo { 6 | pub fn bar() -> Foo { 7 | Foo 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "duplicate_mod" 3 | edition = "2021" 4 | publish = false 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/a.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/b.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/c.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/d.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/from_other_module.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/duplicate_mod/fail/src/other_module/mod.rs: -------------------------------------------------------------------------------- 1 | #[path = "../from_other_module.rs"] 2 | mod m; 3 | -------------------------------------------------------------------------------- /tests/ui-cargo/feature_name/fail/Cargo.toml: -------------------------------------------------------------------------------- 1 | 2 | # Content that triggers the lint goes here 3 | 4 | [package] 5 | name = "feature_name" 6 | version = "0.1.0" 7 | publish = false 8 | 9 | [workspace] 10 | 11 | [features] 12 | use-qwq = [] 13 | use_qwq = [] 14 | with-owo = [] 15 | with_owo = [] 16 | qvq-support = [] 17 | qvq_support = [] 18 | no-qaq = [] 19 | no_qaq = [] 20 | not-orz = [] 21 | not_orz = [] 22 | -------------------------------------------------------------------------------- /tests/ui-cargo/feature_name/fail/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::redundant_feature_names)] 2 | #![warn(clippy::negative_feature_names)] 3 | 4 | fn main() { 5 | // test code goes here 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/feature_name/pass/Cargo.toml: -------------------------------------------------------------------------------- 1 | 2 | # This file should not trigger the lint 3 | 4 | [package] 5 | name = "feature_name" 6 | version = "0.1.0" 7 | publish = false 8 | 9 | [workspace] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/feature_name/pass/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::redundant_feature_names)] 2 | #![warn(clippy::negative_feature_names)] 3 | 4 | fn main() { 5 | // test code goes here 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/lint_groups_priority/fail/src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/lint_groups_priority/pass/src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/src/bad/inner.rs: -------------------------------------------------------------------------------- 1 | pub mod stuff; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/src/bad/inner/stuff.rs: -------------------------------------------------------------------------------- 1 | pub mod most; 2 | 3 | pub struct Inner; 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/src/bad/inner/stuff/most.rs: -------------------------------------------------------------------------------- 1 | pub struct Snarks; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/src/bad/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod inner; 2 | 3 | pub struct Thing; 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::self_named_module_files)] 2 | 3 | mod bad; 4 | 5 | fn main() { 6 | let _ = bad::Thing; 7 | let _ = bad::inner::stuff::Inner; 8 | let _ = bad::inner::stuff::most::Snarks; 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-mod-remap" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod_remap/src/bad.rs: -------------------------------------------------------------------------------- 1 | pub mod inner; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod_remap/src/bad/inner.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_mod_remap/src/main.rs: -------------------------------------------------------------------------------- 1 | // FIXME: find a way to add rustflags to ui-cargo tests 2 | //@compile-flags: --remap-path-prefix {{src-base}}=/remapped 3 | 4 | #![warn(clippy::self_named_module_files)] 5 | 6 | mod bad; 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_no_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fail-no-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_no_mod/src/bad/mod.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/fail_no_mod/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::mod_module_files)] 2 | 3 | mod bad; 4 | 5 | fn main() { 6 | let _ = bad::Thing; 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/src/bad/mod.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::self_named_module_files)] 2 | 3 | mod bad; 4 | mod more; 5 | 6 | fn main() { 7 | let _ = bad::Thing; 8 | let _ = more::foo::Foo; 9 | let _ = more::inner::Inner; 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/src/more/foo.rs: -------------------------------------------------------------------------------- 1 | pub struct Foo; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/src/more/inner/mod.rs: -------------------------------------------------------------------------------- 1 | pub struct Inner; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_mod/src/more/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod foo; 2 | pub mod inner; 3 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_no_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-no-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_no_mod/src/good.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/module_style/pass_no_mod/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::mod_module_files)] 2 | 3 | mod good; 4 | 5 | fn main() { 6 | let _ = good::Thing; 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/no_warn/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "no_warn" 3 | version = "0.1.0" 4 | edition = "2021" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/no_warn/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/no_warn/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/warn/.clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/warn/Cargo.stderr: -------------------------------------------------------------------------------- 1 | warning: using config file `$DIR/tests/ui-cargo/multiple_config_files/warn/.clippy.toml`, `$DIR/tests/ui-cargo/multiple_config_files/warn/clippy.toml` will be ignored 2 | 3 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/warn/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "warn" 3 | version = "0.1.0" 4 | edition = "2021" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/warn/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_config_files/warn/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12145_with_dashes/Cargo.stderr: -------------------------------------------------------------------------------- 1 | error: multiple versions for dependency `winapi`: 0.2.8, 0.3.9 2 | | 3 | = note: `-D clippy::multiple-crate-versions` implied by `-D warnings` 4 | = help: to override `-D warnings` add `#[allow(clippy::multiple_crate_versions)]` 5 | 6 | error: could not compile `multiple-crate-versions` (bin "multiple-crate-versions") due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12145_with_dashes/Cargo.toml: -------------------------------------------------------------------------------- 1 | # Should not lint for dev or build dependencies. See issue 5041. 2 | 3 | [package] 4 | # purposefully separated by - instead of _ 5 | name = "multiple-crate-versions" 6 | version = "0.1.0" 7 | publish = false 8 | 9 | [workspace] 10 | 11 | # One of the versions of winapi is only a dev dependency: allowed 12 | [dependencies] 13 | winapi = "0.2" 14 | ansi_term = "=0.11.0" 15 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12145_with_dashes/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::multiple_crate_versions)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12176_allow_duplicate_crates/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "multiple_crate_versions" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | winapi = "0.2" 10 | ansi_term = "=0.11.0" 11 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12176_allow_duplicate_crates/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-duplicate-crates = ["winapi"] 2 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/12176_allow_duplicate_crates/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::multiple_crate_versions)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/5041_allow_dev_build/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::multiple_crate_versions)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/fail/Cargo.stderr: -------------------------------------------------------------------------------- 1 | error: multiple versions for dependency `winapi`: 0.2.8, 0.3.9 2 | | 3 | = note: `-D clippy::multiple-crate-versions` implied by `-D warnings` 4 | = help: to override `-D warnings` add `#[allow(clippy::multiple_crate_versions)]` 5 | 6 | error: could not compile `multiple_crate_versions` (bin "multiple_crate_versions") due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/fail/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "multiple_crate_versions" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | winapi = "0.2" 10 | ansi_term = "=0.11.0" 11 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/fail/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::multiple_crate_versions)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/pass/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "multiple_crate_versions" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | regex = "1.3.7" 10 | serde = "1.0.110" 11 | -------------------------------------------------------------------------------- /tests/ui-cargo/multiple_crate_versions/pass/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::multiple_crate_versions)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/update-all-references.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Please use 'cargo bless' instead." 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/wildcard_dependencies/fail/Cargo.stderr: -------------------------------------------------------------------------------- 1 | error: wildcard dependency for `regex` 2 | | 3 | = note: `-D clippy::wildcard-dependencies` implied by `-D warnings` 4 | = help: to override `-D warnings` add `#[allow(clippy::wildcard_dependencies)]` 5 | 6 | error: could not compile `wildcard_dependencies` (bin "wildcard_dependencies") due to 1 previous error 7 | -------------------------------------------------------------------------------- /tests/ui-cargo/wildcard_dependencies/fail/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wildcard_dependencies" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | regex = "*" 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/wildcard_dependencies/fail/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::wildcard_dependencies)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-cargo/wildcard_dependencies/pass/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wildcard_dependencies" 3 | version = "0.1.0" 4 | publish = false 5 | 6 | [workspace] 7 | 8 | [dependencies] 9 | regex = "1" 10 | -------------------------------------------------------------------------------- /tests/ui-cargo/wildcard_dependencies/pass/src/main.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::wildcard_dependencies)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-internal/symbol_as_str_unfixable.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix: paths that don't exist yet 2 | #![feature(rustc_private)] 3 | 4 | extern crate rustc_span; 5 | 6 | use rustc_span::Symbol; 7 | 8 | fn f(s: Symbol) { 9 | s.as_str() == "xyz123"; 10 | //~^ symbol_as_str 11 | s.as_str() == "with-dash"; 12 | //~^ symbol_as_str 13 | s.as_str() == "with.dot"; 14 | //~^ symbol_as_str 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui-toml/absolute_paths/allow_crates/clippy.toml: -------------------------------------------------------------------------------- 1 | absolute-paths-allowed-crates = ["core", "crate"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/absolute_paths/allow_long/clippy.toml: -------------------------------------------------------------------------------- 1 | absolute-paths-max-segments = 3 2 | -------------------------------------------------------------------------------- /tests/ui-toml/absolute_paths/default/clippy.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-clippy/d7b27ecbf319446dd9563a433e9694fa3bcd0d8c/tests/ui-toml/absolute_paths/default/clippy.toml -------------------------------------------------------------------------------- /tests/ui-toml/absolute_paths/no_short/clippy.toml: -------------------------------------------------------------------------------- 1 | absolute-paths-max-segments = 0 2 | -------------------------------------------------------------------------------- /tests/ui-toml/allow_mixed_uninlined_format_args/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-mixed-uninlined-format-args = false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_1/clippy.toml: -------------------------------------------------------------------------------- 1 | trait-assoc-item-kinds-order = ["fn", "type", "const", "type"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_2/clippy.toml: -------------------------------------------------------------------------------- 1 | trait-assoc-item-kinds-order = ["const", "type"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_3/clippy.toml: -------------------------------------------------------------------------------- 1 | source-item-ordering = ["enum", "impl", "module", "struct", "trait", "struct"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_4/clippy.toml: -------------------------------------------------------------------------------- 1 | module-items-ordered-within-groupings = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_5/clippy.toml: -------------------------------------------------------------------------------- 1 | module-items-ordered-within-groupings = ["madules"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/bad_conf_6/clippy.toml: -------------------------------------------------------------------------------- 1 | module-items-ordered-within-groupings = ["entirely garbled"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/default/clippy.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-clippy/d7b27ecbf319446dd9563a433e9694fa3bcd0d8c/tests/ui-toml/arbitrary_source_item_ordering/default/clippy.toml -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/only_enum/clippy.toml: -------------------------------------------------------------------------------- 1 | source-item-ordering = ["enum"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/only_impl/clippy.toml: -------------------------------------------------------------------------------- 1 | source-item-ordering = ["impl"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/only_trait/clippy.toml: -------------------------------------------------------------------------------- 1 | source-item-ordering = ["trait"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/ord_in_2/clippy.toml: -------------------------------------------------------------------------------- 1 | module-items-ordered-within-groupings = ["PascalCase"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/ord_in_3/clippy.toml: -------------------------------------------------------------------------------- 1 | source-item-ordering = ["module"] 2 | module-items-ordered-within-groupings = ["PascalCase"] 3 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/ord_within/clippy.toml: -------------------------------------------------------------------------------- 1 | module-items-ordered-within-groupings = "all" 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_5.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: unknown ordering group: `madules` was not specified in `module-items-ordered-within-groupings`, perhaps you meant `modules`? expected one of: `modules`, `use`, `macros`, `global_asm`, `UPPER_SNAKE_CASE`, `PascalCase`, `lower_snake_case` 2 | 3 | error: aborting due to 1 previous error 4 | 5 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/ordering_good.bad_conf_6.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: unknown ordering group: `entirely garbled` was not specified in `module-items-ordered-within-groupings`, expected one of: `modules`, `use`, `macros`, `global_asm`, `UPPER_SNAKE_CASE`, `PascalCase`, `lower_snake_case` 2 | 3 | error: aborting due to 1 previous error 4 | 5 | -------------------------------------------------------------------------------- /tests/ui-toml/arbitrary_source_item_ordering/var_1/clippy.toml: -------------------------------------------------------------------------------- 1 | trait-assoc-item-kinds-order = ["fn", "type", "const"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/arithmetic_side_effects_allowed/clippy.toml: -------------------------------------------------------------------------------- 1 | arithmetic-side-effects-allowed = [ 2 | "OutOfNames" 3 | ] 4 | arithmetic-side-effects-allowed-binary = [ 5 | ["Foo", "Foo"], 6 | ["Foo", "i32"], 7 | ["i32", "Foo"], 8 | ["Bar", "*"], 9 | ["*", "Bar"], 10 | ] 11 | arithmetic-side-effects-allowed-unary = ["Foo"] 12 | -------------------------------------------------------------------------------- /tests/ui-toml/array_size_threshold/array_size_threshold.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused)] 2 | #![warn(clippy::large_const_arrays, clippy::large_stack_arrays)] 3 | //@no-rustfix 4 | const ABOVE: [u8; 11] = [0; 11]; 5 | //~^ large_const_arrays 6 | const BELOW: [u8; 10] = [0; 10]; 7 | 8 | fn main() { 9 | let above = [0u8; 11]; 10 | //~^ large_stack_arrays 11 | let below = [0u8; 10]; 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui-toml/array_size_threshold/clippy.toml: -------------------------------------------------------------------------------- 1 | array-size-threshold = 10 2 | -------------------------------------------------------------------------------- /tests/ui-toml/await_holding_invalid_type/clippy.toml: -------------------------------------------------------------------------------- 1 | await-holding-invalid-types = [ 2 | { path = "std::string::String", reason = "strings are bad" }, 3 | "std::net::Ipv4Addr", 4 | ] 5 | -------------------------------------------------------------------------------- /tests/ui-toml/await_holding_invalid_type_with_replacement/await_holding_invalid_type.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /tests/ui-toml/await_holding_invalid_type_with_replacement/clippy.toml: -------------------------------------------------------------------------------- 1 | await-holding-invalid-types = [ 2 | { path = "std::string::String", replacement = "std::net::Ipv4Addr" }, 3 | ] 4 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml/clippy.toml: -------------------------------------------------------------------------------- 1 | fn this_is_obviously(not: a, toml: file) { 2 | } 3 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml/conf_bad_toml.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: error reading Clippy's configuration file: expected `.`, `=` 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml/conf_bad_toml.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: expected `.`, `=` 2 | --> $DIR/tests/ui-toml/bad_toml/clippy.toml:1:4 3 | | 4 | LL | fn this_is_obviously(not: a, toml: file) { 5 | | ^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml_type/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-names = 42 2 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml_type/conf_bad_type.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: invalid type: integer `42`, expected a sequence 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-toml/bad_toml_type/conf_bad_type.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: invalid type: integer `42`, expected a sequence 2 | --> $DIR/tests/ui-toml/bad_toml_type/clippy.toml:1:20 3 | | 4 | LL | disallowed-names = 42 5 | | ^^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui-toml/borrow_interior_mutable_const/clippy.toml: -------------------------------------------------------------------------------- 1 | ignore-interior-mutability = ["borrow_interior_mutable_const_ignore::Counted"] -------------------------------------------------------------------------------- /tests/ui-toml/check_incompatible_msrv_in_tests/default/clippy.toml: -------------------------------------------------------------------------------- 1 | # default config has check-incompatible-msrv-in-tests as false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/check_incompatible_msrv_in_tests/enabled/clippy.toml: -------------------------------------------------------------------------------- 1 | check-incompatible-msrv-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/collapsible_if/clippy.toml: -------------------------------------------------------------------------------- 1 | lint-commented-code = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/conf_deprecated_key/clippy.toml: -------------------------------------------------------------------------------- 1 | # Expect errors from these deprecated configs 2 | cyclomatic-complexity-threshold = 2 3 | blacklisted-names = [ "..", "wibble" ] 4 | 5 | # that one is white-listed 6 | [third-party] 7 | clippy-feature = "nightly" 8 | -------------------------------------------------------------------------------- /tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::uninlined_format_args)] 2 | 3 | fn main() {} 4 | 5 | #[warn(clippy::cognitive_complexity)] 6 | fn cognitive_complexity() { 7 | //~^ cognitive_complexity 8 | let x = vec![1, 2, 3]; 9 | for i in x { 10 | if i == 1 { 11 | println!("{}", i); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui-toml/dbg_macro/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-dbg-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/decimal_literal_representation/clippy.toml: -------------------------------------------------------------------------------- 1 | literal-representation-threshold = 0xFFFFFF 2 | -------------------------------------------------------------------------------- /tests/ui-toml/decimal_literal_representation/decimal_literal_representation.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::decimal_literal_representation)] 2 | fn main() { 3 | let _ = 8388608; 4 | let _ = 0x00FF_FFFF; 5 | //~^ ERROR: integer literal has a better hexadecimal representation 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui-toml/decimal_literal_representation/decimal_literal_representation.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::decimal_literal_representation)] 2 | fn main() { 3 | let _ = 8388608; 4 | let _ = 16777215; 5 | //~^ ERROR: integer literal has a better hexadecimal representation 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui-toml/declare_interior_mutable_const/clippy.toml: -------------------------------------------------------------------------------- 1 | ignore-interior-mutability = ["declare_interior_mutable_const_ignore::Counted"] -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_macros/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-macros = [ 2 | "std::println", 3 | "std::vec", 4 | { path = "std::cfg" }, 5 | { path = "serde::Serialize", reason = "no serializing" }, 6 | "macros::expr", 7 | "macros::stmt", 8 | "macros::ty", 9 | "macros::pat", 10 | "macros::item", 11 | "macros::binop", 12 | "macros::attr", 13 | "proc_macros::Derive", 14 | ] 15 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_names_append/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-names = ["ducks", ".."] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_names_append/disallowed_names.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::disallowed_names)] 2 | 3 | fn main() { 4 | // `foo` is part of the default configuration 5 | let foo = "bar"; 6 | //~^ disallowed_names 7 | // `ducks` was unrightfully disallowed 8 | let ducks = ["quack", "quack"]; 9 | //~^ disallowed_names 10 | // `fox` is okay 11 | let fox = ["what", "does", "the", "fox", "say", "?"]; 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_names_replace/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-names = ["ducks"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_names_replace/disallowed_names.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::disallowed_names)] 2 | 3 | fn main() { 4 | // `foo` is part of the default configuration 5 | let foo = "bar"; 6 | // `ducks` was unrightfully disallowed 7 | let ducks = ["quack", "quack"]; 8 | //~^ disallowed_names 9 | // `fox` is okay 10 | let fox = ["what", "does", "the", "fox", "say", "?"]; 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_script_idents/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-scripts = ["Cyrillic"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/disallowed_script_idents/disallowed_script_idents.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::disallowed_script_idents)] 2 | fn main() { 3 | let счётчик = 10; 4 | let カウンタ = 10; 5 | //~^ ERROR: identifier `カウンタ` has a Unicode script that is not allowed by configuration 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui-toml/doc_valid_idents_append/clippy.toml: -------------------------------------------------------------------------------- 1 | doc-valid-idents = ["ClipPy", ".."] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/doc_valid_idents_append/doc_markdown.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | /// This is a special interface for ClipPy which doesn't require backticks 4 | fn allowed_name() {} 5 | 6 | /// OAuth and LaTeX are inside Clippy's default list. 7 | fn default_name() {} 8 | 9 | /// TestItemThingyOfCoolness might sound cool but is not on the list and should be linted. 10 | //~^ doc_markdown 11 | fn unknown_name() {} 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui-toml/doc_valid_idents_replace/clippy.toml: -------------------------------------------------------------------------------- 1 | doc-valid-idents = ["ClipPy"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys/clippy.toml: -------------------------------------------------------------------------------- 1 | cognitive-complexity-threshold = 2 2 | cognitive-complexity-threshold = 4 3 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys/duplicated_keys.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: duplicate key `cognitive-complexity-threshold` 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys/duplicated_keys.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: duplicate key `cognitive-complexity-threshold` in document root 2 | --> $DIR/tests/ui-toml/duplicated_keys/clippy.toml:2:1 3 | | 4 | LL | cognitive-complexity-threshold = 4 5 | | ^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys_deprecated/clippy.toml: -------------------------------------------------------------------------------- 1 | cognitive-complexity-threshold = 2 2 | # This is the deprecated name for the same key 3 | cyclomatic-complexity-threshold = 3 4 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys_deprecated/duplicated_keys.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys_deprecated_2/clippy.toml: -------------------------------------------------------------------------------- 1 | # This is the deprecated name for cognitive-complexity-threshold 2 | cyclomatic-complexity-threshold = 3 3 | # Check we get duplication warning regardless of order 4 | cognitive-complexity-threshold = 4 5 | -------------------------------------------------------------------------------- /tests/ui-toml/duplicated_keys_deprecated_2/duplicated_keys.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /tests/ui-toml/enum_variant_size/clippy.toml: -------------------------------------------------------------------------------- 1 | enum-variant-size-threshold = 500 2 | -------------------------------------------------------------------------------- /tests/ui-toml/enum_variant_size/enum_variant_size.fixed: -------------------------------------------------------------------------------- 1 | enum Fine { 2 | A(()), 3 | B([u8; 500]), 4 | } 5 | enum Bad { 6 | //~^ ERROR: large size difference between variants 7 | A(()), 8 | B(Box<[u8; 501]>), 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-toml/enum_variant_size/enum_variant_size.rs: -------------------------------------------------------------------------------- 1 | enum Fine { 2 | A(()), 3 | B([u8; 500]), 4 | } 5 | enum Bad { 6 | //~^ ERROR: large size difference between variants 7 | A(()), 8 | B([u8; 501]), 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-toml/excessive_nesting/clippy.toml: -------------------------------------------------------------------------------- 1 | excessive-nesting-threshold = 4 2 | -------------------------------------------------------------------------------- /tests/ui-toml/expect_used/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-expect-in-consts = false 2 | allow-expect-in-tests = true 3 | -------------------------------------------------------------------------------- /tests/ui-toml/explicit_iter_loop/clippy.toml: -------------------------------------------------------------------------------- 1 | enforce-iter-loop-reborrow = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/explicit_iter_loop/explicit_iter_loop.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::explicit_iter_loop)] 2 | 3 | fn main() { 4 | let mut vec = vec![1, 2, 3]; 5 | let rmvec = &mut vec; 6 | for _ in &*rmvec {} 7 | //~^ ERROR: it is more concise to loop over references to containers 8 | for _ in &mut *rmvec {} 9 | //~^ ERROR: it is more concise to loop over references to containers 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-toml/explicit_iter_loop/explicit_iter_loop.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::explicit_iter_loop)] 2 | 3 | fn main() { 4 | let mut vec = vec![1, 2, 3]; 5 | let rmvec = &mut vec; 6 | for _ in rmvec.iter() {} 7 | //~^ ERROR: it is more concise to loop over references to containers 8 | for _ in rmvec.iter_mut() {} 9 | //~^ ERROR: it is more concise to loop over references to containers 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-toml/extra_unused_type_parameters/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/extra_unused_type_parameters/extra_unused_type_parameters.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | pub struct S; 3 | 4 | impl S { 5 | pub fn exported_fn() { 6 | unimplemented!(); 7 | } 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui-toml/fn_params_excessive_bools/clippy.toml: -------------------------------------------------------------------------------- 1 | max-fn-params-bools = 1 2 | -------------------------------------------------------------------------------- /tests/ui-toml/fn_params_excessive_bools/test.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::fn_params_excessive_bools)] 2 | 3 | fn f(_: bool) {} 4 | fn g(_: bool, _: bool) {} 5 | //~^ fn_params_excessive_bools 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/functions_maxlines/clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-lines-threshold = 1 2 | -------------------------------------------------------------------------------- /tests/ui-toml/good_toml_no_false_negatives/clippy.toml: -------------------------------------------------------------------------------- 1 | # that one is white-listed 2 | [third-party] 3 | clippy-feature = "nightly" 4 | -------------------------------------------------------------------------------- /tests/ui-toml/good_toml_no_false_negatives/conf_no_false_negatives.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /tests/ui-toml/ifs_same_cond/clippy.toml: -------------------------------------------------------------------------------- 1 | ignore-interior-mutability = ["std::cell::Cell"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/impl_trait_in_params/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false -------------------------------------------------------------------------------- /tests/ui-toml/indexing_slicing/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-indexing-slicing-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/invalid_min_rust_version/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "invalid.version" 2 | -------------------------------------------------------------------------------- /tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: not a valid Rust version 2 | 3 | #![allow(clippy::redundant_clone)] 4 | 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui-toml/invalid_min_rust_version/invalid_min_rust_version.stderr: -------------------------------------------------------------------------------- 1 | error: error reading Clippy's configuration file: not a valid Rust version 2 | --> $DIR/tests/ui-toml/invalid_min_rust_version/clippy.toml:1:8 3 | | 4 | LL | msrv = "invalid.version" 5 | | ^^^^^^^^^^^^^^^^^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/allow_exact_repetitions/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-exact-repetitions = false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/allow_exact_repetitions/item_name_repetitions.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::module_name_repetitions)] 2 | #![allow(dead_code)] 3 | 4 | pub mod foo { 5 | // this line should produce a warning: 6 | pub fn foo() {} 7 | //~^ module_name_repetitions 8 | 9 | // but this line shouldn't 10 | pub fn to_foo() {} 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/allowed_prefixes/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-prefixes = ["bar"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/allowed_prefixes_extend/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-prefixes = ["..", "bar"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/threshold0/clippy.toml: -------------------------------------------------------------------------------- 1 | struct-field-name-threshold = 0 2 | enum-variant-name-threshold = 0 3 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/threshold0/item_name_repetitions.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | 3 | struct Data {} 4 | 5 | enum Actions {} 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/item_name_repetitions/threshold5/clippy.toml: -------------------------------------------------------------------------------- 1 | enum-variant-name-threshold = 5 2 | struct-field-name-threshold = 5 3 | -------------------------------------------------------------------------------- /tests/ui-toml/large_futures/clippy.toml: -------------------------------------------------------------------------------- 1 | future-size-threshold = 1024 2 | -------------------------------------------------------------------------------- /tests/ui-toml/large_include_file/clippy.toml: -------------------------------------------------------------------------------- 1 | max-include-file-size = 600 2 | -------------------------------------------------------------------------------- /tests/ui-toml/large_include_file/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang/rust-clippy/d7b27ecbf319446dd9563a433e9694fa3bcd0d8c/tests/ui-toml/large_include_file/empty.txt -------------------------------------------------------------------------------- /tests/ui-toml/large_stack_frames/clippy.toml: -------------------------------------------------------------------------------- 1 | stack-size-threshold = 1000 2 | -------------------------------------------------------------------------------- /tests/ui-toml/large_types_passed_by_value/clippy.toml: -------------------------------------------------------------------------------- 1 | pass-by-value-size-limit = 512 2 | -------------------------------------------------------------------------------- /tests/ui-toml/large_types_passed_by_value/large_types_passed_by_value.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::large_types_passed_by_value)] 2 | 3 | fn f(_v: [u8; 512]) {} 4 | fn f2(_v: &[u8; 513]) {} 5 | //~^ ERROR: this argument (513 byte) is passed by value 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/large_types_passed_by_value/large_types_passed_by_value.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::large_types_passed_by_value)] 2 | 3 | fn f(_v: [u8; 512]) {} 4 | fn f2(_v: [u8; 513]) {} 5 | //~^ ERROR: this argument (513 byte) is passed by value 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/lint_decimal_readability/clippy.toml: -------------------------------------------------------------------------------- 1 | unreadable-literal-lint-fractions = false -------------------------------------------------------------------------------- /tests/ui-toml/macro_metavars_in_unsafe/private/clippy.toml: -------------------------------------------------------------------------------- 1 | warn-unsafe-macro-metavars-in-private-macros = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/macro_metavars_in_unsafe/private/test.rs: -------------------------------------------------------------------------------- 1 | //! Tests macro_metavars_in_unsafe with private (non-exported) macros 2 | #![warn(clippy::macro_metavars_in_unsafe)] 3 | 4 | macro_rules! mac { 5 | ($v:expr) => { 6 | unsafe { 7 | //~^ ERROR: this macro expands metavariables in an unsafe block 8 | dbg!($v); 9 | } 10 | }; 11 | } 12 | 13 | fn main() { 14 | mac!(1); 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui-toml/manual_let_else/clippy.toml: -------------------------------------------------------------------------------- 1 | matches-for-let-else = "AllTypes" 2 | -------------------------------------------------------------------------------- /tests/ui-toml/manual_let_else/manual_let_else.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::manual_let_else)] 2 | 3 | enum Foo { 4 | A(u8), 5 | B, 6 | } 7 | 8 | fn main() { 9 | let Foo::A(x) = Foo::A(1) else { return }; 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-toml/manual_let_else/manual_let_else.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::manual_let_else)] 2 | 3 | enum Foo { 4 | A(u8), 5 | B, 6 | } 7 | 8 | fn main() { 9 | let x = match Foo::A(1) { 10 | //~^ ERROR: this could be rewritten as `let...else` 11 | Foo::A(x) => x, 12 | Foo::B => return, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui-toml/max_suggested_slice_pattern_length/clippy.toml: -------------------------------------------------------------------------------- 1 | max-suggested-slice-pattern-length = 8 2 | -------------------------------------------------------------------------------- /tests/ui-toml/min_ident_chars/auxiliary/extern_types.rs: -------------------------------------------------------------------------------- 1 | #![allow(nonstandard_style, unused)] 2 | 3 | pub struct Aaa; 4 | pub struct Bbb; 5 | 6 | pub const N: u32 = 3; 7 | 8 | pub const M: u32 = 2; 9 | pub const LONGER: u32 = 32; 10 | -------------------------------------------------------------------------------- /tests/ui-toml/min_ident_chars/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-idents-below-min-chars = ["Owo", "Uwu", "wha", "t_e", "lse", "_do", "_i_", "put", "her", "_e"] 2 | min-ident-chars-threshold = 3 3 | -------------------------------------------------------------------------------- /tests/ui-toml/min_rust_version/clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.0.0" 2 | -------------------------------------------------------------------------------- /tests/ui-toml/missing_docs_allow_unused/clippy.toml: -------------------------------------------------------------------------------- 1 | missing-docs-allow-unused = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/module_inception/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-private-module-inception = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/modulo_arithmetic/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-comparison-to-zero = false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/modulo_arithmetic/modulo_arithmetic.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::modulo_arithmetic)] 2 | 3 | fn main() { 4 | let a = -1; 5 | let b = 2; 6 | let c = a % b == 0; 7 | //~^ modulo_arithmetic 8 | let c = a % b != 0; 9 | //~^ modulo_arithmetic 10 | let c = 0 == a % b; 11 | //~^ modulo_arithmetic 12 | let c = 0 != a % b; 13 | //~^ modulo_arithmetic 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui-toml/mut_key/clippy.toml: -------------------------------------------------------------------------------- 1 | ignore-interior-mutability = ["mut_key::Counted"] -------------------------------------------------------------------------------- /tests/ui-toml/needless_pass_by_ref_mut/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_pass_by_ref_mut)] 2 | #![allow(clippy::ptr_arg)] 3 | 4 | // Should warn 5 | pub fn pub_foo(s: &Vec, b: &u32, x: &mut u32) { 6 | //~^ ERROR: this argument is a mutable reference, but not used mutably 7 | *x += *b + s.len() as u32; 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui-toml/needless_pass_by_ref_mut/needless_pass_by_ref_mut.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_pass_by_ref_mut)] 2 | #![allow(clippy::ptr_arg)] 3 | 4 | // Should warn 5 | pub fn pub_foo(s: &mut Vec, b: &u32, x: &mut u32) { 6 | //~^ ERROR: this argument is a mutable reference, but not used mutably 7 | *x += *b + s.len() as u32; 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui-toml/needless_raw_string_hashes_one_allowed/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-one-hash-in-raw-strings = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.fixed: -------------------------------------------------------------------------------- 1 | #![allow(clippy::no_effect, unused)] 2 | #![warn(clippy::needless_raw_string_hashes)] 3 | 4 | fn main() { 5 | r#"\aaa"#; 6 | r#"\aaa"#; 7 | //~^ needless_raw_string_hashes 8 | r#"Hello "world"!"#; 9 | //~^ needless_raw_string_hashes 10 | r####" "### "## "# "####; 11 | //~^ needless_raw_string_hashes 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::no_effect, unused)] 2 | #![warn(clippy::needless_raw_string_hashes)] 3 | 4 | fn main() { 5 | r#"\aaa"#; 6 | r##"\aaa"##; 7 | //~^ needless_raw_string_hashes 8 | r##"Hello "world"!"##; 9 | //~^ needless_raw_string_hashes 10 | r######" "### "## "# "######; 11 | //~^ needless_raw_string_hashes 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui-toml/nonstandard_macro_braces/auxiliary/proc_macro_derive.rs: -------------------------------------------------------------------------------- 1 | extern crate proc_macro; 2 | 3 | use proc_macro::TokenStream; 4 | 5 | #[proc_macro_derive(DeriveSomething)] 6 | pub fn derive(_: TokenStream) -> TokenStream { 7 | "fn _f() -> Vec { vec![] }".parse().unwrap() 8 | } 9 | 10 | #[proc_macro] 11 | pub fn foo_bar(_: TokenStream) -> TokenStream { 12 | "fn issue_7422() { eprintln!(); }".parse().unwrap() 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui-toml/nonstandard_macro_braces/clippy.toml: -------------------------------------------------------------------------------- 1 | standard-macro-braces = [ 2 | { name = "quote", brace = "{" }, 3 | { name = "quote::quote", brace = "{" }, 4 | { name = "eprint", brace = "[" }, 5 | { name = "type_pos", brace = "[" }, 6 | ] 7 | -------------------------------------------------------------------------------- /tests/ui-toml/panic/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-panic-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/path_ends_with_ext/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-dotfiles = ["dot"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/path_ends_with_ext/path_ends_with_ext.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | 3 | #![warn(clippy::path_ends_with_ext)] 4 | 5 | use std::path::Path; 6 | 7 | fn f(p: &Path) { 8 | p.ends_with(".dot"); 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-toml/print_macro/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-print-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/private-doc-errors/clippy.toml: -------------------------------------------------------------------------------- 1 | check-private-items = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/pub_crate_missing_docs/clippy.toml: -------------------------------------------------------------------------------- 1 | missing-docs-in-crate-items = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/pub_underscore_fields/all_pub_fields/clippy.toml: -------------------------------------------------------------------------------- 1 | pub-underscore-fields-behavior = "AllPubFields" -------------------------------------------------------------------------------- /tests/ui-toml/pub_underscore_fields/exported/clippy.toml: -------------------------------------------------------------------------------- 1 | pub-underscore-fields-behavior = "PubliclyExported" 2 | -------------------------------------------------------------------------------- /tests/ui-toml/renamed_function_params/default/clippy.toml: -------------------------------------------------------------------------------- 1 | # Ignore `From`, `TryFrom`, `FromStr` by default 2 | # allow-renamed-params-for = [] 3 | -------------------------------------------------------------------------------- /tests/ui-toml/renamed_function_params/extend/clippy.toml: -------------------------------------------------------------------------------- 1 | # Ignore `From`, `TryFrom`, `FromStr` by default 2 | allow-renamed-params-for = [ "..", "std::ops::Add", "renamed_function_params::MyTrait" ] 3 | -------------------------------------------------------------------------------- /tests/ui-toml/replaceable_disallowed_types/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-types = [ 2 | { path = "std::string::String", replacement = "wrapper::String" }, 3 | ] 4 | -------------------------------------------------------------------------------- /tests/ui-toml/result_large_err/clippy.toml: -------------------------------------------------------------------------------- 1 | large-error-threshold = 512 2 | -------------------------------------------------------------------------------- /tests/ui-toml/result_large_err/result_large_err.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::result_large_err)] 2 | 3 | fn f() -> Result<(), [u8; 511]> { 4 | todo!() 5 | } 6 | fn f2() -> Result<(), [u8; 512]> { 7 | //~^ ERROR: the `Err`-variant returned from this function is very large 8 | todo!() 9 | } 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui-toml/semicolon_block/clippy.toml: -------------------------------------------------------------------------------- 1 | semicolon-inside-block-ignore-singleline = true 2 | semicolon-outside-block-ignore-multiline = true 3 | -------------------------------------------------------------------------------- /tests/ui-toml/strict_non_send_fields_in_send_ty/clippy.toml: -------------------------------------------------------------------------------- 1 | enable-raw-pointer-heuristic-for-send = false 2 | -------------------------------------------------------------------------------- /tests/ui-toml/struct_excessive_bools/clippy.toml: -------------------------------------------------------------------------------- 1 | max-struct-bools = 0 2 | -------------------------------------------------------------------------------- /tests/ui-toml/struct_excessive_bools/test.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::struct_excessive_bools)] 2 | 3 | struct S { 4 | //~^ struct_excessive_bools 5 | a: bool, 6 | } 7 | 8 | struct Foo; 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui-toml/suppress_lint_in_const/clippy.toml: -------------------------------------------------------------------------------- 1 | suppress-restriction-lint-in-const = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_disallow/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-names = ["toto", "tata", "titi"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_inconsistent_struct_constructor/clippy.toml: -------------------------------------------------------------------------------- 1 | check-inconsistent-struct-field-initializers = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_invalid_path/clippy.toml: -------------------------------------------------------------------------------- 1 | [[disallowed-macros]] 2 | path = "bool" 3 | 4 | [[disallowed-methods]] 5 | path = "std::process::current_exe" 6 | 7 | [[disallowed-methods]] 8 | path = "" 9 | 10 | [[disallowed-types]] 11 | path = "std::result::Result::Err" 12 | 13 | # negative test 14 | 15 | [[disallowed-methods]] 16 | path = "std::current_exe" 17 | allow-invalid = true 18 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_invalid_path/conf_invalid_path.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: expected a macro, found a primitive type 2 | //@error-in-other-file: `std::process::current_exe` does not refer to a reachable function 3 | //@error-in-other-file: `` does not refer to a reachable function 4 | //@error-in-other-file: expected a type, found a variant 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_replaceable_disallowed_methods/clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-methods = [ 2 | { path = "replaceable_disallowed_methods::bad", replacement = "good" }, 3 | { path = "replaceable_disallowed_methods::questionable", replacement = "good", reason = "a better function exists" }, 4 | ] 5 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_replaceable_disallowed_methods/replaceable_disallowed_methods.fixed: -------------------------------------------------------------------------------- 1 | fn bad() {} 2 | fn questionable() {} 3 | fn good() {} 4 | 5 | fn main() { 6 | good(); 7 | //~^ disallowed_methods 8 | good(); 9 | //~^ disallowed_methods 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_replaceable_disallowed_methods/replaceable_disallowed_methods.rs: -------------------------------------------------------------------------------- 1 | fn bad() {} 2 | fn questionable() {} 3 | fn good() {} 4 | 5 | fn main() { 6 | bad(); 7 | //~^ disallowed_methods 8 | questionable(); 9 | //~^ disallowed_methods 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_trivially_copy/clippy.toml: -------------------------------------------------------------------------------- 1 | trivial-copy-size-limit = 2 2 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unknown_config_struct_field/clippy.toml: -------------------------------------------------------------------------------- 1 | # In the following configuration, "recommendation" should be "reason" or "replacement". 2 | disallowed-macros = [ 3 | { path = "std::panic", recommendation = "return a `std::result::Result::Error` instead" }, 4 | ] 5 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unknown_config_struct_field/toml_unknown_config_struct_field.rs: -------------------------------------------------------------------------------- 1 | #[rustfmt::skip] 2 | //@error-in-other-file: error reading Clippy's configuration file: data did not match any variant of untagged enum DisallowedPathEnum 3 | fn main() { 4 | panic!(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unknown_key/clippy.toml: -------------------------------------------------------------------------------- 1 | # that one is an error 2 | foobar = 42 3 | # so is this one 4 | barfoo = 53 5 | 6 | # when using underscores instead of dashes, suggest the correct one 7 | allow_mixed_uninlined_format_args = true 8 | 9 | # that one is ignored 10 | [third-party] 11 | clippy-feature = "nightly" 12 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unknown_key/conf_unknown_key.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix 2 | //@error-in-other-file: unknown field 3 | //@error-in-other-file: error reading Clippy 4 | //@error-in-other-file: error reading Clippy 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unloaded_crate/clippy.toml: -------------------------------------------------------------------------------- 1 | # The first two `disallowed-methods` paths should generate warnings, but the third should not. 2 | 3 | [[disallowed-methods]] 4 | path = "regex::Regex::new_" 5 | 6 | [[disallowed-methods]] 7 | path = "regex::Regex_::new" 8 | 9 | [[disallowed-methods]] 10 | path = "regex_::Regex::new" 11 | -------------------------------------------------------------------------------- /tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: `regex::Regex::new_` does not refer to a reachable function 2 | //@error-in-other-file: `regex::Regex_::new` does not refer to a reachable function 3 | 4 | extern crate regex; 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/ui-toml/too_large_for_stack/boxed_local.rs: -------------------------------------------------------------------------------- 1 | fn f(x: Box<[u8; 500]>) {} 2 | //~^ ERROR: local variable doesn't need to be boxed here 3 | fn f2(x: Box<[u8; 501]>) {} 4 | 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui-toml/too_large_for_stack/boxed_local.stderr: -------------------------------------------------------------------------------- 1 | error: local variable doesn't need to be boxed here 2 | --> tests/ui-toml/too_large_for_stack/boxed_local.rs:1:6 3 | | 4 | LL | fn f(x: Box<[u8; 500]>) {} 5 | | ^ 6 | | 7 | = note: `-D clippy::boxed-local` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::boxed_local)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui-toml/too_large_for_stack/clippy.toml: -------------------------------------------------------------------------------- 1 | too-large-for-stack = 500 2 | -------------------------------------------------------------------------------- /tests/ui-toml/too_large_for_stack/useless_vec.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::useless_vec)] 2 | 3 | fn main() { 4 | let x = [0u8; 500]; 5 | //~^ ERROR: useless use of `vec!` 6 | x.contains(&1); 7 | let y = vec![0u8; 501]; 8 | y.contains(&1); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui-toml/too_large_for_stack/useless_vec.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::useless_vec)] 2 | 3 | fn main() { 4 | let x = vec![0u8; 500]; 5 | //~^ ERROR: useless use of `vec!` 6 | x.contains(&1); 7 | let y = vec![0u8; 501]; 8 | y.contains(&1); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui-toml/too_many_arguments/clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-arguments-threshold = 10 2 | -------------------------------------------------------------------------------- /tests/ui-toml/too_many_arguments/too_many_arguments.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::too_many_arguments)] 2 | 3 | fn not_too_many(p1: u8, p2: u8, p3: u8, p4: u8, p5: u8, p6: u8, p7: u8, p8: u8, p9: u8, p10: u8) {} 4 | fn too_many(p1: u8, p2: u8, p3: u8, p4: u8, p5: u8, p6: u8, p7: u8, p8: u8, p9: u8, p10: u8, p11: u8) {} 5 | //~^ ERROR: this function has too many arguments 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/type_complexity/clippy.toml: -------------------------------------------------------------------------------- 1 | type-complexity-threshold = 500 2 | -------------------------------------------------------------------------------- /tests/ui-toml/type_complexity/type_complexity.rs: -------------------------------------------------------------------------------- 1 | // 480 2 | fn f(_: (u8, (u8, (u8, (u8, (u8, (u8,))))))) {} 3 | // 550 4 | fn f2(_: (u8, (u8, (u8, (u8, (u8, (u8, u8))))))) {} 5 | //~^ ERROR: very complex type used 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui-toml/type_repetition_in_bounds/clippy.toml: -------------------------------------------------------------------------------- 1 | max-trait-bounds = 5 2 | -------------------------------------------------------------------------------- /tests/ui-toml/type_repetition_in_bounds/main.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_maybe_sized)] 2 | #![warn(clippy::type_repetition_in_bounds)] 3 | 4 | fn f() 5 | where 6 | T: Copy + Clone + Sync + Send + ?Sized + Unpin, 7 | T: PartialEq, 8 | { 9 | } 10 | 11 | fn f2() 12 | where 13 | T: Copy + Clone + Sync + Send + ?Sized, 14 | T: Unpin + PartialEq, 15 | //~^ type_repetition_in_bounds 16 | { 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /tests/ui-toml/undocumented_unsafe_blocks/default/clippy.toml: -------------------------------------------------------------------------------- 1 | # default configuration has `accept-comment-above-statement` and 2 | # `accept-comment-above-attributes` true 3 | -------------------------------------------------------------------------------- /tests/ui-toml/undocumented_unsafe_blocks/disabled/clippy.toml: -------------------------------------------------------------------------------- 1 | # test with these options disabled 2 | accept-comment-above-statement = false 3 | accept-comment-above-attributes = false 4 | -------------------------------------------------------------------------------- /tests/ui-toml/unnecessary_box_returns/clippy.toml: -------------------------------------------------------------------------------- 1 | unnecessary-box-size = 64 2 | -------------------------------------------------------------------------------- /tests/ui-toml/unnecessary_box_returns/unnecessary_box_returns.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unnecessary_box_returns)] 2 | 3 | fn f() -> [u8; 64] { 4 | //~^ ERROR: boxed return of the sized type `[u8; 64]` 5 | todo!() 6 | } 7 | fn f2() -> Box<[u8; 65]> { 8 | todo!() 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-toml/unnecessary_box_returns/unnecessary_box_returns.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unnecessary_box_returns)] 2 | 3 | fn f() -> Box<[u8; 64]> { 4 | //~^ ERROR: boxed return of the sized type `[u8; 64]` 5 | todo!() 6 | } 7 | fn f2() -> Box<[u8; 65]> { 8 | todo!() 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui-toml/unwrap_used/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-unwrap-in-consts = false 2 | allow-unwrap-in-tests = true 3 | -------------------------------------------------------------------------------- /tests/ui-toml/unwrap_used/unwrap_used_const.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unwrap_used)] 2 | 3 | fn main() { 4 | const SOME: Option = Some(3); 5 | const UNWRAPPED: i32 = SOME.unwrap(); 6 | //~^ ERROR: used `unwrap()` on an `Option` value 7 | const { 8 | SOME.unwrap(); 9 | //~^ ERROR: used `unwrap()` on an `Option` value 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui-toml/update-all-references.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Please use 'cargo bless' instead." 4 | -------------------------------------------------------------------------------- /tests/ui-toml/upper_case_acronyms_aggressive/clippy.toml: -------------------------------------------------------------------------------- 1 | upper-case-acronyms-aggressive = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/useless_vec/clippy.toml: -------------------------------------------------------------------------------- 1 | allow-useless-vec-in-tests = true 2 | -------------------------------------------------------------------------------- /tests/ui-toml/useless_vec/useless_vec.stderr: -------------------------------------------------------------------------------- 1 | error: useless use of `vec!` 2 | --> tests/ui-toml/useless_vec/useless_vec.rs:8:9 3 | | 4 | LL | foo(&vec![1_u32]); 5 | | ^^^^^^^^^^^^ help: you can use a slice directly: `&[1_u32]` 6 | | 7 | = note: `-D clippy::useless-vec` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::useless_vec)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui-toml/vec_box_sized/clippy.toml: -------------------------------------------------------------------------------- 1 | vec-box-size-threshold = 4 2 | -------------------------------------------------------------------------------- /tests/ui-toml/vec_box_sized/test.fixed: -------------------------------------------------------------------------------- 1 | struct S { 2 | x: u64, 3 | } 4 | 5 | struct C { 6 | y: u16, 7 | } 8 | 9 | struct Foo(Vec); 10 | //~^ vec_box 11 | struct Bar(Vec); 12 | //~^ vec_box 13 | struct Quux(Vec>); 14 | struct Baz(Vec>); 15 | struct BarBaz(Vec>); 16 | struct FooBarBaz(Vec); 17 | //~^ vec_box 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /tests/ui-toml/vec_box_sized/test.rs: -------------------------------------------------------------------------------- 1 | struct S { 2 | x: u64, 3 | } 4 | 5 | struct C { 6 | y: u16, 7 | } 8 | 9 | struct Foo(Vec>); 10 | //~^ vec_box 11 | struct Bar(Vec>); 12 | //~^ vec_box 13 | struct Quux(Vec>); 14 | struct Baz(Vec>); 15 | struct BarBaz(Vec>); 16 | struct FooBarBaz(Vec>); 17 | //~^ vec_box 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /tests/ui-toml/verbose_bit_mask/clippy.toml: -------------------------------------------------------------------------------- 1 | verbose-bit-mask-threshold = 31 2 | -------------------------------------------------------------------------------- /tests/ui-toml/verbose_bit_mask/verbose_bit_mask.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::verbose_bit_mask)] 2 | fn main() { 3 | let v: i32 = 0; 4 | let _ = v & 0b11111 == 0; 5 | let _ = v.trailing_zeros() >= 6; 6 | //~^ ERROR: bit mask could be simplified 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui-toml/verbose_bit_mask/verbose_bit_mask.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::verbose_bit_mask)] 2 | fn main() { 3 | let v: i32 = 0; 4 | let _ = v & 0b11111 == 0; 5 | let _ = v & 0b111111 == 0; 6 | //~^ ERROR: bit mask could be simplified 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui-toml/wildcard_imports/clippy.toml: -------------------------------------------------------------------------------- 1 | warn-on-all-wildcard-imports = true 2 | 3 | # This should be ignored since `warn-on-all-wildcard-imports` has higher precedence 4 | allowed-wildcard-imports = ["utils"] 5 | -------------------------------------------------------------------------------- /tests/ui-toml/wildcard_imports_whitelist/clippy.toml: -------------------------------------------------------------------------------- 1 | allowed-wildcard-imports = ["utils"] 2 | -------------------------------------------------------------------------------- /tests/ui-toml/zero_single_char_names/clippy.toml: -------------------------------------------------------------------------------- 1 | single-char-binding-names-threshold = 0 2 | -------------------------------------------------------------------------------- /tests/ui-toml/zero_single_char_names/zero_single_char_names.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | #![warn(clippy::many_single_char_names)] 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /tests/ui/as_pointer_underscore.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::as_pointer_underscore)] 2 | #![crate_type = "lib"] 3 | #![no_std] 4 | 5 | struct S; 6 | 7 | fn f(s: &S) -> usize { 8 | &s as *const &S as usize 9 | //~^ as_pointer_underscore 10 | } 11 | 12 | fn g(s: &mut S) -> usize { 13 | s as *mut S as usize 14 | //~^ as_pointer_underscore 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/as_pointer_underscore.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::as_pointer_underscore)] 2 | #![crate_type = "lib"] 3 | #![no_std] 4 | 5 | struct S; 6 | 7 | fn f(s: &S) -> usize { 8 | &s as *const _ as usize 9 | //~^ as_pointer_underscore 10 | } 11 | 12 | fn g(s: &mut S) -> usize { 13 | s as *mut _ as usize 14 | //~^ as_pointer_underscore 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/as_underscore.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::as_underscore)] 2 | 3 | fn foo(_n: usize) {} 4 | 5 | fn main() { 6 | let n: u16 = 256; 7 | foo(n as usize); 8 | //~^ as_underscore 9 | 10 | let n = 0_u128; 11 | let _n: u8 = n as u8; 12 | //~^ as_underscore 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/as_underscore.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::as_underscore)] 2 | 3 | fn foo(_n: usize) {} 4 | 5 | fn main() { 6 | let n: u16 = 256; 7 | foo(n as _); 8 | //~^ as_underscore 9 | 10 | let n = 0_u128; 11 | let _n: u8 = n as _; 12 | //~^ as_underscore 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/author.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn main() { 4 | #[clippy::author] 5 | let x: char = 0x45 as char; 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/author.stdout: -------------------------------------------------------------------------------- 1 | if let StmtKind::Let(local) = stmt.kind 2 | && let Some(init) = local.init 3 | && let ExprKind::Cast(expr, cast_ty) = init.kind 4 | && let ExprKind::Lit(ref lit) = expr.kind 5 | && let LitKind::Int(69, LitIntType::Unsuffixed) = lit.node 6 | && let PatKind::Binding(BindingMode::NONE, _, name, None) = local.pat.kind 7 | && name.as_str() == "x" 8 | { 9 | // report your lint here 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/author/call.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn main() { 4 | #[clippy::author] 5 | let _ = ::std::cmp::min(3, 4); 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/author/if.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::all)] 4 | 5 | fn main() { 6 | #[clippy::author] 7 | let _ = if true { 8 | 1 == 1; 9 | } else { 10 | 2 == 2; 11 | }; 12 | 13 | let a = true; 14 | 15 | #[clippy::author] 16 | if let true = a { 17 | } else { 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /tests/ui/author/issue_3849.stdout: -------------------------------------------------------------------------------- 1 | if let StmtKind::Let(local) = stmt.kind 2 | && let Some(init) = local.init 3 | && let ExprKind::Call(func, args) = init.kind 4 | && is_path_diagnostic_item(cx, func, sym::transmute) 5 | && args.len() == 1 6 | && let PatKind::Wild = local.pat.kind 7 | { 8 | // report your lint here 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/author/macro_in_closure.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::uninlined_format_args)] 4 | 5 | fn main() { 6 | #[clippy::author] 7 | let print_text = |x| println!("{}", x); 8 | print_text("hello"); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/author/macro_in_loop.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![feature(stmt_expr_attributes)] 4 | #![allow(clippy::uninlined_format_args)] 5 | 6 | fn main() { 7 | #[clippy::author] 8 | for i in 0..1 { 9 | println!("{}", i); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/author/matches.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::let_and_return)] 4 | 5 | fn main() { 6 | #[clippy::author] 7 | let a = match 42 { 8 | 16 => 5, 9 | 17 => { 10 | let x = 3; 11 | x 12 | }, 13 | _ => 1, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/author/repeat.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[allow(clippy::no_effect)] 4 | fn main() { 5 | #[clippy::author] 6 | [1_u8; 5]; 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/auxiliary/extern_fake_libc.rs: -------------------------------------------------------------------------------- 1 | #![allow(nonstandard_style)] 2 | #![allow(clippy::missing_safety_doc, unused)] 3 | 4 | type pid_t = i32; 5 | pub unsafe fn getpid() -> pid_t { 6 | pid_t::from(0) 7 | } 8 | pub fn getpid_SAFE_TRUTH() -> pid_t { 9 | unsafe { getpid() } 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/auxiliary/external_consts.rs: -------------------------------------------------------------------------------- 1 | pub const MAGIC_NUMBER: i32 = 1; 2 | -------------------------------------------------------------------------------- /tests/ui/auxiliary/external_item.rs: -------------------------------------------------------------------------------- 1 | pub struct _ExternalStruct {} 2 | 3 | impl _ExternalStruct { 4 | pub fn _foo(self) {} 5 | } 6 | 7 | pub fn _exernal_foo() {} 8 | -------------------------------------------------------------------------------- /tests/ui/auxiliary/test_macro.rs: -------------------------------------------------------------------------------- 1 | pub trait A {} 2 | 3 | macro_rules! __implicit_hasher_test_macro { 4 | (impl< $($impl_arg:tt),* > for $kind:ty where $($bounds:tt)*) => { 5 | __implicit_hasher_test_macro!( ($($impl_arg),*) ($kind) ($($bounds)*) ); 6 | }; 7 | 8 | (($($impl_arg:tt)*) ($($kind_arg:tt)*) ($($bounds:tt)*)) => { 9 | impl< $($impl_arg)* > test_macro::A for $($kind_arg)* where $($bounds)* { } 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/auxiliary/use_self_macro.rs: -------------------------------------------------------------------------------- 1 | macro_rules! use_self { 2 | ( 3 | impl $ty:ident { 4 | fn func(&$this:ident) { 5 | [fields($($field:ident)*)] 6 | } 7 | } 8 | ) => ( 9 | impl $ty { 10 | fn func(&$this) { 11 | let $ty { $($field),* } = $this; 12 | } 13 | } 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/borrow_and_ref_as_ptr.fixed: -------------------------------------------------------------------------------- 1 | // Make sure that `ref_as_ptr` is not emitted when `borrow_as_ptr` is. 2 | 3 | #![warn(clippy::ref_as_ptr, clippy::borrow_as_ptr)] 4 | 5 | fn f(_: T) {} 6 | 7 | fn main() { 8 | let mut val = 0; 9 | f(&raw const val); 10 | //~^ borrow_as_ptr 11 | f(&raw mut val); 12 | //~^ borrow_as_ptr 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/borrow_and_ref_as_ptr.rs: -------------------------------------------------------------------------------- 1 | // Make sure that `ref_as_ptr` is not emitted when `borrow_as_ptr` is. 2 | 3 | #![warn(clippy::ref_as_ptr, clippy::borrow_as_ptr)] 4 | 5 | fn f(_: T) {} 6 | 7 | fn main() { 8 | let mut val = 0; 9 | f(&val as *const _); 10 | //~^ borrow_as_ptr 11 | f(&mut val as *mut i32); 12 | //~^ borrow_as_ptr 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/borrow_as_ptr_no_std.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::borrow_as_ptr)] 2 | #![no_std] 3 | #![crate_type = "lib"] 4 | 5 | #[clippy::msrv = "1.75"] 6 | pub fn main(_argc: isize, _argv: *const *const u8) -> isize { 7 | let val = 1; 8 | let _p = core::ptr::addr_of!(val); 9 | //~^ borrow_as_ptr 10 | 11 | let mut val_mut = 1; 12 | let _p_mut = core::ptr::addr_of_mut!(val_mut); 13 | //~^ borrow_as_ptr 14 | 0 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/borrow_as_ptr_no_std.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::borrow_as_ptr)] 2 | #![no_std] 3 | #![crate_type = "lib"] 4 | 5 | #[clippy::msrv = "1.75"] 6 | pub fn main(_argc: isize, _argv: *const *const u8) -> isize { 7 | let val = 1; 8 | let _p = &val as *const i32; 9 | //~^ borrow_as_ptr 10 | 11 | let mut val_mut = 1; 12 | let _p_mut = &mut val_mut as *mut i32; 13 | //~^ borrow_as_ptr 14 | 0 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/borrow_deref_ref_unfixable.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix: overlapping suggestions 2 | #![allow(dead_code, unused_variables)] 3 | 4 | fn main() {} 5 | 6 | mod should_lint { 7 | fn two_helps() { 8 | let s = &String::new(); 9 | let x: &str = &*s; 10 | //~^ borrow_deref_ref 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/builtin_type_shadow.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::builtin_type_shadow)] 2 | #![allow(non_camel_case_types)] 3 | 4 | fn foo(a: u32) -> u32 { 5 | //~^ builtin_type_shadow 6 | 42 //~ ERROR: mismatched type 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/bytes_nth.fixed: -------------------------------------------------------------------------------- 1 | #![allow(clippy::unnecessary_operation)] 2 | #![allow(clippy::sliced_string_as_bytes)] 3 | #![warn(clippy::bytes_nth)] 4 | 5 | fn main() { 6 | let s = String::from("String"); 7 | let _ = s.as_bytes().get(3).copied(); 8 | //~^ bytes_nth 9 | let _ = &s.as_bytes()[3]; 10 | //~^ bytes_nth 11 | let _ = s[..].as_bytes().get(3).copied(); 12 | //~^ bytes_nth 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/bytes_nth.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::unnecessary_operation)] 2 | #![allow(clippy::sliced_string_as_bytes)] 3 | #![warn(clippy::bytes_nth)] 4 | 5 | fn main() { 6 | let s = String::from("String"); 7 | let _ = s.bytes().nth(3); 8 | //~^ bytes_nth 9 | let _ = &s.bytes().nth(3).unwrap(); 10 | //~^ bytes_nth 11 | let _ = s[..].bytes().nth(3); 12 | //~^ bytes_nth 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/char_lit_as_u8.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::char_lit_as_u8)] 2 | 3 | fn main() { 4 | // no suggestion, since a byte literal won't work. 5 | let _ = '❤' as u8; 6 | //~^ char_lit_as_u8 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/char_lit_as_u8_suggestions.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::char_lit_as_u8)] 2 | 3 | fn main() { 4 | let _ = b'a'; 5 | //~^ char_lit_as_u8 6 | let _ = b'\n'; 7 | //~^ char_lit_as_u8 8 | let _ = b'\0'; 9 | //~^ char_lit_as_u8 10 | let _ = b'\x01'; 11 | //~^ char_lit_as_u8 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/char_lit_as_u8_suggestions.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::char_lit_as_u8)] 2 | 3 | fn main() { 4 | let _ = 'a' as u8; 5 | //~^ char_lit_as_u8 6 | let _ = '\n' as u8; 7 | //~^ char_lit_as_u8 8 | let _ = '\0' as u8; 9 | //~^ char_lit_as_u8 10 | let _ = '\x01' as u8; 11 | //~^ char_lit_as_u8 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/cognitive_complexity_attr_used.rs: -------------------------------------------------------------------------------- 1 | #![warn(unused, clippy::cognitive_complexity)] 2 | #![allow(unused_crate_dependencies)] 3 | 4 | fn main() { 5 | kaboom(); 6 | } 7 | 8 | #[clippy::cognitive_complexity = "0"] 9 | fn kaboom() { 10 | //~^ cognitive_complexity 11 | 12 | if 42 == 43 { 13 | panic!(); 14 | } else if "cake" == "lie" { 15 | println!("what?"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/ui/crashes/associated-constant-ice.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Test for https://github.com/rust-lang/rust-clippy/issues/1698 3 | 4 | pub trait Trait { 5 | const CONSTANT: u8; 6 | } 7 | 8 | impl Trait for u8 { 9 | const CONSTANT: u8 = 2; 10 | } 11 | 12 | fn main() { 13 | println!("{}", u8::CONSTANT * 10); 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/ice-4727-aux.rs: -------------------------------------------------------------------------------- 1 | pub trait Trait { 2 | fn fun(par: &str) -> &str; 3 | } 4 | 5 | impl Trait for str { 6 | fn fun(par: &str) -> &str { 7 | &par[0..1] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/ice-7272-aux.rs: -------------------------------------------------------------------------------- 1 | pub fn warn(_: T) {} 2 | 3 | macro_rules! define_macro { 4 | ($d:tt $lower:ident $upper:ident) => { 5 | #[macro_export] 6 | macro_rules! $upper { 7 | ($arg:tt) => { 8 | $crate::$lower($arg) 9 | }; 10 | } 11 | }; 12 | } 13 | 14 | define_macro! {$ warn WARNING} 15 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/ice-7868-aux.rs: -------------------------------------------------------------------------------- 1 | fn zero() { 2 | unsafe { 0 }; 3 | //~^ ERROR: unsafe block missing a safety comment 4 | //~| NOTE: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings` 5 | } 6 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/ice-7934-aux.rs: -------------------------------------------------------------------------------- 1 | fn zero() { 2 | // SAFETY: 3 | unsafe { 0 }; 4 | } 5 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/ice-8681-aux.rs: -------------------------------------------------------------------------------- 1 | pub fn foo(x: &u32) -> u32 { 2 | /* Safety: 3 | * This is totally ok. 4 | */ 5 | unsafe { *(x as *const u32) } 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/crashes/auxiliary/use_self_macro.rs: -------------------------------------------------------------------------------- 1 | macro_rules! use_self { 2 | ( 3 | impl $ty:ident { 4 | fn func(&$this:ident) { 5 | [fields($($field:ident)*)] 6 | } 7 | } 8 | ) => ( 9 | impl $ty { 10 | fn func(&$this) { 11 | let $ty { $($field),* } = $this; 12 | } 13 | } 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/enum-glob-import-crate.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | use std::*; 4 | 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-10148.rs: -------------------------------------------------------------------------------- 1 | //@aux-build:../auxiliary/proc_macros.rs 2 | //@no-rustfix 3 | extern crate proc_macros; 4 | 5 | use proc_macros::with_span; 6 | 7 | fn main() { 8 | println!(with_span!(""something "")); 9 | //~^ println_empty_string 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-10508a.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Used to overflow in `is_normalizable` 3 | 4 | use std::marker::PhantomData; 5 | 6 | struct Node { 7 | m: PhantomData<&'static T>, 8 | } 9 | 10 | struct Digit { 11 | elem: T, 12 | } 13 | 14 | enum FingerTree { 15 | Single(T), 16 | 17 | Deep(Digit, Box>>), 18 | } 19 | 20 | fn main() {} 21 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-10508c.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[derive(Debug)] 4 | struct S { 5 | t: T, 6 | s: Box>, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-10912.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unreadable_literal)] 2 | //@no-rustfix 3 | fn f2() -> impl Sized { && 3.14159265358979323846E } 4 | //~^ ERROR: expected at least one digit in exponent 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-10912.stderr: -------------------------------------------------------------------------------- 1 | error: expected at least one digit in exponent 2 | --> tests/ui/crashes/ice-10912.rs:3:28 3 | | 4 | LL | fn f2() -> impl Sized { && 3.14159265358979323846E } 5 | | ^^^^^^^^^^^^^^^^^^^^^^^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-11337.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![feature(trait_alias)] 4 | 5 | trait Confusing = Fn(i32) where F: Fn(u32); 6 | 7 | fn alias, F>(_: T, _: F) {} 8 | 9 | fn main() { 10 | alias(|_| {}, |_| {}); 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-11755.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::unused_enumerate_index)] 4 | 5 | fn main() { 6 | for () in [()].iter() {} 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-11803.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix 2 | 3 | #![warn(clippy::impl_trait_in_params)] 4 | 5 | pub fn g>>() { 6 | //~^ impl_trait_in_params 7 | //~| impl_trait_in_params 8 | extern "C" fn implementation_detail() {} 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-11939.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::unit_arg, clippy::no_effect)] 4 | 5 | const fn v(_: ()) {} 6 | 7 | fn main() { 8 | if true { 9 | v({ 10 | [0; 1 + 1]; 11 | }); 12 | Some(()) 13 | } else { 14 | None 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12253.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[allow(overflowing_literals, unconditional_panic, clippy::no_effect)] 4 | fn main() { 5 | let arr: [i32; 5] = [0; 5]; 6 | arr[0xfffffe7ffffffffffffffffffffffff]; 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12491.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_return)] 2 | 3 | fn main() { 4 | if (true) { 5 | // anything一些中文 6 | //~^ needless_return 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12491.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_return)] 2 | 3 | fn main() { 4 | if (true) { 5 | // anything一些中文 6 | return; 7 | //~^ needless_return 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12616.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::ptr_as_ptr)] 2 | #![allow(clippy::unnecessary_operation, clippy::unnecessary_cast)] 3 | 4 | fn main() { 5 | let s = std::ptr::null::<()>; 6 | s().cast::<()>(); 7 | //~^ ptr_as_ptr 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12616.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::ptr_as_ptr)] 2 | #![allow(clippy::unnecessary_operation, clippy::unnecessary_cast)] 3 | 4 | fn main() { 5 | let s = std::ptr::null::<()>; 6 | s() as *const (); 7 | //~^ ptr_as_ptr 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12979.1.fixed: -------------------------------------------------------------------------------- 1 | #[deny(clippy::declare_interior_mutable_const)] //~ empty_line_after_outer_attr 2 | const FOO: u8 = 0; 3 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12979.2.fixed: -------------------------------------------------------------------------------- 1 | #![deny(clippy::declare_interior_mutable_const)] //~ empty_line_after_outer_attr 2 | 3 | const FOO: u8 = 0; 4 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-12979.rs: -------------------------------------------------------------------------------- 1 | #[deny(clippy::declare_interior_mutable_const)] //~ empty_line_after_outer_attr 2 | 3 | const FOO: u8 = 0; 4 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-13544-reduced.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | #![warn(clippy::significant_drop_tightening)] 3 | #![allow(unused, clippy::no_effect)] 4 | 5 | use std::marker::PhantomData; 6 | 7 | trait Trait { 8 | type Assoc: Trait; 9 | } 10 | struct S(*const S, PhantomData); 11 | 12 | fn f(x: &mut S) { 13 | &mut x.0; 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-14303.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | #![warn(clippy::macro_use_imports)] 3 | 4 | #[repr(transparent)] 5 | pub struct X(()); 6 | 7 | #[repr(u8)] 8 | pub enum Action { 9 | Off = 0, 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-14325.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | 3 | #![allow(clippy::redundant_pattern_matching)] 4 | 5 | struct S<'a> { 6 | s: &'a str, 7 | } 8 | 9 | fn foo() -> Option> { 10 | if let Some(_) = Some(0) { 11 | Some(S { s: "xyz" }) 12 | } else { 13 | None 14 | } 15 | } 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-1588.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![expect(clippy::no_effect)] 4 | 5 | // Test for https://github.com/rust-lang/rust-clippy/issues/1588 6 | 7 | fn main() { 8 | match 1 { 9 | 1 => {}, 10 | 2 => { 11 | [0; 1]; 12 | }, 13 | _ => {}, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-1969.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | // Test for https://github.com/rust-lang/rust-clippy/issues/1969 4 | 5 | fn main() {} 6 | 7 | pub trait Convert { 8 | type Action: From<*const f64>; 9 | 10 | fn convert(val: *const f64) -> Self::Action { 11 | val.into() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-2727.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Test for https://github.com/rust-lang/rust-clippy/issues/2727 3 | 4 | pub fn f(new: fn()) { 5 | new(); 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-2862.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Test for https://github.com/rust-lang/rust-clippy/issues/2862 3 | 4 | pub trait FooMap { 5 | fn map B>(&self, f: F) -> B; 6 | } 7 | 8 | impl FooMap for bool { 9 | fn map B>(&self, f: F) -> B { 10 | f() 11 | } 12 | } 13 | 14 | fn main() { 15 | let a = true; 16 | a.map(|| false); 17 | } 18 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-2865.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(dead_code, clippy::extra_unused_lifetimes)] 4 | 5 | // Test for https://github.com/rust-lang/rust-clippy/issues/2865 6 | 7 | struct Ice { 8 | size: String, 9 | } 10 | 11 | impl<'a> From for Ice { 12 | fn from(_: String) -> Self { 13 | let text = || "iceberg".to_string(); 14 | Self { size: text() } 15 | } 16 | } 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3151.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Test for https://github.com/rust-lang/rust-clippy/issues/3151 3 | 4 | #[derive(Clone)] 5 | pub struct HashMap { 6 | hash_builder: S, 7 | table: RawTable, 8 | } 9 | 10 | #[derive(Clone)] 11 | pub struct RawTable { 12 | size: usize, 13 | val: V, 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3462.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![expect(clippy::disallowed_names)] 4 | 5 | // Test for https://github.com/rust-lang/rust-clippy/issues/3462 6 | 7 | enum Foo { 8 | Bar, 9 | Baz, 10 | } 11 | 12 | fn bar(foo: Foo) { 13 | macro_rules! baz { 14 | () => { 15 | if let Foo::Bar = foo {} 16 | }; 17 | } 18 | 19 | baz!(); 20 | baz!(); 21 | } 22 | 23 | fn main() {} 24 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-360.rs: -------------------------------------------------------------------------------- 1 | fn main() {} 2 | //@no-rustfix 3 | fn no_panic(slice: &[T]) { 4 | let mut iter = slice.iter(); 5 | loop { 6 | //~^ never_loop 7 | //~| while_let_loop 8 | 9 | let _ = match iter.next() { 10 | Some(ele) => ele, 11 | None => break, 12 | }; 13 | loop {} 14 | //~^ empty_loop 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3717.fixed: -------------------------------------------------------------------------------- 1 | #![deny(clippy::implicit_hasher)] 2 | 3 | use std::collections::HashSet; 4 | 5 | fn main() {} 6 | 7 | pub fn ice_3717(_: &HashSet) { 8 | //~^ implicit_hasher 9 | 10 | let _ = [0u8; 0]; 11 | let _: HashSet = HashSet::default(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3717.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::implicit_hasher)] 2 | 3 | use std::collections::HashSet; 4 | 5 | fn main() {} 6 | 7 | pub fn ice_3717(_: &HashSet) { 8 | //~^ implicit_hasher 9 | 10 | let _ = [0u8; 0]; 11 | let _: HashSet = HashSet::new(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3741.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build:proc_macro_crash.rs 3 | 4 | #![warn(clippy::suspicious_else_formatting)] 5 | 6 | extern crate proc_macro_crash; 7 | use proc_macro_crash::macro_test; 8 | 9 | fn main() { 10 | macro_test!(2); 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3747.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Test for https://github.com/rust-lang/rust-clippy/issues/3747 3 | 4 | macro_rules! a { 5 | ( $pub:tt $($attr:tt)* ) => { 6 | $($attr)* $pub fn say_hello() {} 7 | }; 8 | } 9 | 10 | macro_rules! b { 11 | () => { 12 | a! { pub } 13 | }; 14 | } 15 | 16 | b! {} 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3891.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | 1x; 3 | //~^ ERROR: invalid suffix `x` for number literal 4 | } 5 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-3891.stderr: -------------------------------------------------------------------------------- 1 | error: invalid suffix `x` for number literal 2 | --> tests/ui/crashes/ice-3891.rs:2:5 3 | | 4 | LL | 1x; 5 | | ^^ invalid suffix `x` 6 | | 7 | = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) 8 | 9 | error: aborting due to 1 previous error 10 | 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4121.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | use std::mem; 4 | 5 | pub struct Foo(A, B); 6 | 7 | impl Foo { 8 | const HOST_SIZE: usize = mem::size_of::(); 9 | 10 | pub fn crash() -> bool { 11 | Self::HOST_SIZE == 0 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4545.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn repro() { 4 | trait Foo { 5 | type Bar; 6 | } 7 | 8 | #[allow(dead_code)] 9 | struct Baz { 10 | field: T::Bar, 11 | } 12 | } 13 | 14 | fn main() { 15 | repro(); 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4579.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::single_match)] 4 | 5 | use std::ptr; 6 | 7 | fn main() { 8 | match Some(0_usize) { 9 | Some(_) => { 10 | let s = "012345"; 11 | unsafe { ptr::read(s.as_ptr().offset(1) as *const [u8; 5]) }; 12 | }, 13 | _ => (), 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4671.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::use_self)] 4 | 5 | #[macro_use] 6 | #[path = "auxiliary/use_self_macro.rs"] 7 | mod use_self_macro; 8 | 9 | struct Foo { 10 | a: u32, 11 | } 12 | 13 | use_self! { 14 | impl Foo { 15 | fn func(&self) { 16 | [fields( 17 | a 18 | )] 19 | } 20 | } 21 | } 22 | 23 | fn main() {} 24 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4727.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::use_self)] 4 | 5 | #[path = "auxiliary/ice-4727-aux.rs"] 6 | mod aux; 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4760.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(non_local_definitions)] 4 | 5 | const COUNT: usize = 2; 6 | struct Thing; 7 | trait Dummy {} 8 | 9 | const _: () = { 10 | impl Dummy for Thing where [i32; COUNT]: Sized {} 11 | }; 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-4775.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::uninlined_format_args)] 4 | 5 | pub struct ArrayWrapper([usize; N]); 6 | 7 | impl ArrayWrapper<{ N }> { 8 | pub fn ice(&self) { 9 | for i in self.0.iter() { 10 | println!("{}", i); 11 | } 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5207.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Regression test for https://github.com/rust-lang/rust-clippy/issues/5207 3 | pub async fn bar<'a, T: 'a>(_: T) {} 4 | 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5238.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Regression test for #5238 / https://github.com/rust-lang/rust/pull/69562 3 | 4 | #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] 5 | 6 | fn main() { 7 | let _ = #[coroutine] 8 | || { 9 | yield; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5389.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::explicit_counter_loop)] 4 | 5 | fn main() { 6 | let v = vec![1, 2, 3]; 7 | let mut i = 0; 8 | let max_storage_size = [0; 128 * 1024]; 9 | for item in &v { 10 | bar(i, *item); 11 | i += 1; 12 | } 13 | } 14 | 15 | fn bar(_: usize, _: u32) {} 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5497.rs: -------------------------------------------------------------------------------- 1 | // reduced from rustc issue-69020-assoc-const-arith-overflow.rs 2 | #![allow(clippy::out_of_bounds_indexing)] 3 | 4 | pub fn main() {} 5 | 6 | pub trait Foo { 7 | const OOB: i32; 8 | } 9 | 10 | impl Foo for Vec { 11 | const OOB: i32 = [1][1] + T::OOB; 12 | //~^ ERROR: operation will panic 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5497.stderr: -------------------------------------------------------------------------------- 1 | error: this operation will panic at runtime 2 | --> tests/ui/crashes/ice-5497.rs:11:22 3 | | 4 | LL | const OOB: i32 = [1][1] + T::OOB; 5 | | ^^^^^^ index out of bounds: the length is 1 but the index is 1 6 | | 7 | = note: `#[deny(unconditional_panic)]` on by default 8 | 9 | error: aborting due to 1 previous error 10 | 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5579.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::unnecessary_literal_unwrap)] 4 | 5 | trait IsErr { 6 | fn is_err(&self, err: &str) -> bool; 7 | } 8 | 9 | impl IsErr for Option { 10 | fn is_err(&self, _err: &str) -> bool { 11 | true 12 | } 13 | } 14 | 15 | fn main() { 16 | let t = Some(1); 17 | 18 | if t.is_err("") { 19 | t.unwrap(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5835.1.fixed: -------------------------------------------------------------------------------- 1 | #[rustfmt::skip] 2 | pub struct Foo { 3 | /// 位 4 | //~^ tabs_in_doc_comments 5 | //~| empty_line_after_doc_comments 6 | /// ^ Do not remove this tab character. 7 | /// It was required to trigger the ICE. 8 | pub bar: u8, 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5835.2.fixed: -------------------------------------------------------------------------------- 1 | #[rustfmt::skip] 2 | pub struct Foo { 3 | // /// 位 4 | //~^ tabs_in_doc_comments 5 | //~| empty_line_after_doc_comments 6 | 7 | 8 | /// ^ Do not remove this tab character. 9 | /// It was required to trigger the ICE. 10 | pub bar: u8, 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5835.fixed: -------------------------------------------------------------------------------- 1 | #[rustfmt::skip] 2 | pub struct Foo { 3 | //~v tabs_in_doc_comments 4 | /// 位 5 | /// ^ Do not remove this tab character. 6 | /// It was required to trigger the ICE. 7 | pub bar: u8, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5835.rs: -------------------------------------------------------------------------------- 1 | #[rustfmt::skip] 2 | pub struct Foo { 3 | //~v tabs_in_doc_comments 4 | /// 位 5 | /// ^ Do not remove this tab character. 6 | /// It was required to trigger the ICE. 7 | pub bar: u8, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5835.stderr: -------------------------------------------------------------------------------- 1 | error: using tabs in doc comments is not recommended 2 | --> tests/ui/crashes/ice-5835.rs:4:10 3 | | 4 | LL | /// 位 5 | | ^^^^ help: consider using four spaces per tab 6 | | 7 | = note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5872.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_collect)] 2 | 3 | fn main() { 4 | let _ = vec![1, 2, 3].into_iter().next().is_none(); 5 | //~^ needless_collect 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5872.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::needless_collect)] 2 | 3 | fn main() { 4 | let _ = vec![1, 2, 3].into_iter().collect::>().is_empty(); 5 | //~^ needless_collect 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-5944.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::repeat_once)] 4 | #![allow(clippy::let_unit_value)] 5 | 6 | trait Repeat { 7 | fn repeat(&self) {} 8 | } 9 | 10 | impl Repeat for usize { 11 | fn repeat(&self) {} 12 | } 13 | 14 | fn main() { 15 | let _ = 42.repeat(); 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-6139.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | trait T<'a> {} 4 | 5 | fn foo(_: Vec>>) {} 6 | 7 | fn main() { 8 | foo(vec![]); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-6153.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | pub struct S<'a, 'e>(&'a str, &'e str); 4 | 5 | pub type T<'a, 'e> = std::collections::HashMap, ()>; 6 | 7 | impl<'e, 'a: 'e> S<'a, 'e> { 8 | pub fn foo(_a: &str, _b: &str, _map: &T) {} 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-6251.rs: -------------------------------------------------------------------------------- 1 | // originally from glacier/fixed/77329.rs 2 | // assertion failed: `(left == right)` ; different DefIds 3 | //@no-rustfix 4 | fn bug() -> impl Iterator { 5 | //~^ ERROR: the size for values 6 | //~| ERROR: the size for values 7 | //~| ERROR: mismatched types 8 | std::iter::empty() 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-6256.rs: -------------------------------------------------------------------------------- 1 | // originally from rustc ./tests/ui/regions/issue-78262.rs 2 | // ICE: to get the signature of a closure, use args.as_closure().sig() not fn_sig() 3 | #![allow(clippy::upper_case_acronyms)] 4 | 5 | trait TT {} 6 | 7 | impl dyn TT { 8 | fn func(&self) {} 9 | } 10 | 11 | #[rustfmt::skip] 12 | fn main() { 13 | let f = |x: &dyn TT| x.func(); 14 | //~^ ERROR: borrowed data escapes outside of closure 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-6332.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn cmark_check() { 4 | let mut link_err = false; 5 | macro_rules! cmark_error { 6 | ($bad:expr) => { 7 | *$bad = true; 8 | }; 9 | } 10 | cmark_error!(&mut link_err); 11 | } 12 | 13 | pub fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-700.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | // Test for https://github.com/rust-lang/rust-clippy/issues/700 4 | 5 | fn core() {} 6 | 7 | fn main() { 8 | core(); 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7012.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![expect(clippy::single_match)] 4 | 5 | enum _MyOption { 6 | None, 7 | Some(()), 8 | } 9 | 10 | impl _MyOption { 11 | fn _foo(&self) { 12 | match self { 13 | &Self::Some(_) => {}, 14 | _ => {}, 15 | } 16 | } 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7126.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // This test requires a feature gated const fn and will stop working in the future. 3 | 4 | #![feature(const_btree_len)] 5 | 6 | use std::collections::BTreeMap; 7 | 8 | struct Foo(usize); 9 | impl Foo { 10 | fn new() -> Self { 11 | Self(BTreeMap::len(&BTreeMap::::new())) 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7169.fixed: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_if)] 2 | 3 | #[derive(Default)] 4 | struct A { 5 | a: Vec>, 6 | b: T, 7 | } 8 | 9 | fn main() { 10 | if Ok::<_, ()>(A::::default()).is_ok() {} 11 | //~^ redundant_pattern_matching 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7169.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::needless_if)] 2 | 3 | #[derive(Default)] 4 | struct A { 5 | a: Vec>, 6 | b: T, 7 | } 8 | 9 | fn main() { 10 | if let Ok(_) = Ok::<_, ()>(A::::default()) {} 11 | //~^ redundant_pattern_matching 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7231.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::never_loop)] 4 | 5 | async fn f() { 6 | loop { 7 | break; 8 | } 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7272.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build:ice-7272-aux.rs 3 | 4 | #![allow(clippy::no_effect)] 5 | 6 | extern crate ice_7272_aux; 7 | 8 | use ice_7272_aux::*; 9 | 10 | pub fn main() { 11 | || WARNING!("Style changed!"); 12 | || "}{"; 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7340.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::no_effect)] 4 | 5 | fn main() { 6 | const CONSTANT: usize = 8; 7 | [1; 1 % CONSTANT]; 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7423.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | pub trait Trait { 4 | fn f(); 5 | } 6 | 7 | impl Trait for usize { 8 | fn f() { 9 | unsafe extern "C" { 10 | fn g() -> usize; 11 | } 12 | } 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7868.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: 2 | #![warn(clippy::undocumented_unsafe_blocks)] 3 | #![allow(clippy::no_effect)] 4 | 5 | #[path = "auxiliary/ice-7868-aux.rs"] 6 | mod zero; 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7869.rs: -------------------------------------------------------------------------------- 1 | enum Tila { 2 | //~^ enum_variant_names 3 | TyöAlkoi, 4 | TyöKeskeytyi, 5 | TyöValmis, 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-7934.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::undocumented_unsafe_blocks)] 4 | #![allow(clippy::no_effect)] 5 | 6 | #[path = "auxiliary/ice-7934-aux.rs"] 7 | mod zero; 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-8250.fixed: -------------------------------------------------------------------------------- 1 | fn _f(s: &str) -> Option<()> { 2 | let _ = s[1..].split('.').next()?; 3 | //~^ needless_splitn 4 | 5 | Some(()) 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-8250.rs: -------------------------------------------------------------------------------- 1 | fn _f(s: &str) -> Option<()> { 2 | let _ = s[1..].splitn(2, '.').next()?; 3 | //~^ needless_splitn 4 | 5 | Some(()) 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-8386.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn f(x: u32, mut arg: &String) {} 4 | 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-8681.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build: ice-8681-aux.rs 3 | 4 | #![warn(clippy::undocumented_unsafe_blocks)] 5 | 6 | #[path = "auxiliary/ice-8681-aux.rs"] 7 | mod ice_8681_aux; 8 | 9 | fn main() { 10 | let _ = ice_8681_aux::foo(&0u32); 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-8821.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::let_unit_value)] 4 | 5 | fn f() {} 6 | static FN: fn() = f; 7 | 8 | fn main() { 9 | let _: () = FN(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9041.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | //@no-rustfix 3 | pub fn has_thing(things: &[Thing]) -> bool { 4 | let is_thing_ready = |_peer: &Thing| -> bool { todo!() }; 5 | things.iter().find(|p| is_thing_ready(p)).is_some() 6 | //~^ search_is_some 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9238.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(incomplete_features)] 4 | #![feature(generic_const_exprs)] 5 | #![warn(clippy::branches_sharing_code)] 6 | 7 | const fn f() -> usize { 8 | 2 9 | } 10 | const C: [f64; f()] = [0f64; f()]; 11 | 12 | fn main() { 13 | let _ = if true { C[0] } else { C[1] }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9242.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | enum E { 4 | X(), 5 | Y, 6 | } 7 | 8 | fn main() { 9 | let _ = if let E::X() = E::X() { 1 } else { 2 }; 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9405.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::useless_format)] 4 | #![allow(clippy::print_literal)] 5 | 6 | fn main() { 7 | println!( 8 | "\ 9 | 10 | {}", 11 | "multiple skipped lines" 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9405.stderr: -------------------------------------------------------------------------------- 1 | warning: multiple lines skipped by escaped newline 2 | --> tests/ui/crashes/ice-9405.rs:8:10 3 | | 4 | LL | "\ 5 | | __________^ 6 | LL | | 7 | LL | | {}", 8 | | |____________^ skipping everything up to and including this point 9 | 10 | warning: 1 warning emitted 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9414.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::result_large_err)] 4 | 5 | trait T {} 6 | fn f(_: &u32) -> Result<(), *const (dyn '_ + T)> { 7 | Ok(()) 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9459.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![feature(unsized_fn_params)] 4 | 5 | pub fn f0(_f: dyn FnOnce()) {} 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9463.rs: -------------------------------------------------------------------------------- 1 | #![deny(arithmetic_overflow)] 2 | fn main() { 3 | let _x = -1_i32 >> -1; 4 | //~^ ERROR: this arithmetic operation will overflow 5 | let _y = 1u32 >> 10000000000000u32; 6 | //~^ ERROR: this arithmetic operation will overflow 7 | //~| ERROR: literal out of range 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9625.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn main() { 4 | let x = &1; 5 | let _ = &1 < x && x < &10; 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-96721.fixed: -------------------------------------------------------------------------------- 1 | macro_rules! foo { 2 | () => { 3 | "bar.rs" 4 | }; 5 | } 6 | 7 | #[path = "file"] //~ ERROR: malformed `path` attribute 8 | mod abc {} 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-96721.rs: -------------------------------------------------------------------------------- 1 | macro_rules! foo { 2 | () => { 3 | "bar.rs" 4 | }; 5 | } 6 | 7 | #[path = foo!()] //~ ERROR: malformed `path` attribute 8 | mod abc {} 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-96721.stderr: -------------------------------------------------------------------------------- 1 | error: malformed `path` attribute input 2 | --> tests/ui/crashes/ice-96721.rs:7:1 3 | | 4 | LL | #[path = foo!()] 5 | | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[path = "file"]` 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice-9746.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //! 3 | 4 | trait Trait {} 5 | 6 | struct Struct<'a> { 7 | _inner: &'a Struct<'a>, 8 | } 9 | 10 | impl Trait for Struct<'_> {} 11 | 12 | fn example<'a>(s: &'a Struct) -> Box> { 13 | Box::new(Box::new(Struct { _inner: s })) 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /tests/ui/crashes/ice_exact_size.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | // Test for https://github.com/rust-lang/rust-clippy/issues/1336 4 | 5 | struct Foo; 6 | 7 | impl Iterator for Foo { 8 | type Item = (); 9 | 10 | fn next(&mut self) -> Option<()> { 11 | let _ = self.len() == 0; 12 | unimplemented!() 13 | } 14 | } 15 | 16 | impl ExactSizeIterator for Foo {} 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/ui/crashes/if_same_then_else.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![deny(clippy::if_same_then_else)] 4 | 5 | // Test for https://github.com/rust-lang/rust-clippy/issues/2426 6 | 7 | fn main() {} 8 | 9 | pub fn foo(a: i32, b: i32) -> Option<&'static str> { 10 | if a == b { 11 | None 12 | } else if a > b { 13 | Some("a pfeil b") 14 | } else { 15 | None 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/ui/crashes/implements-trait.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[allow(clippy::needless_borrowed_reference)] 4 | fn main() { 5 | let mut v = Vec::::new(); 6 | let _ = v.iter_mut().filter(|&ref a| a.is_empty()); 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/crashes/missing_const_for_fn_14774.fixed: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Z validate-mir 2 | #![warn(clippy::missing_const_for_fn)] 3 | 4 | static BLOCK_FN_DEF: fn(usize) -> usize = { 5 | //~v missing_const_for_fn 6 | const fn foo(a: usize) -> usize { 7 | a + 10 8 | } 9 | foo 10 | }; 11 | struct X; 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/missing_const_for_fn_14774.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Z validate-mir 2 | #![warn(clippy::missing_const_for_fn)] 3 | 4 | static BLOCK_FN_DEF: fn(usize) -> usize = { 5 | //~v missing_const_for_fn 6 | fn foo(a: usize) -> usize { 7 | a + 10 8 | } 9 | foo 10 | }; 11 | struct X; 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/needless_borrow_fp.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[derive(Debug)] 4 | pub enum Error { 5 | Type(&'static str), 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/crashes/needless_pass_by_value-w-late-bound.fixed: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust/issues/107147 2 | 3 | #![warn(clippy::needless_pass_by_value)] 4 | 5 | struct Foo<'a>(&'a [(); 100]); 6 | 7 | fn test(x: &Foo<'_>) {} 8 | //~^ needless_pass_by_value 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/needless_pass_by_value-w-late-bound.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust/issues/107147 2 | 3 | #![warn(clippy::needless_pass_by_value)] 4 | 5 | struct Foo<'a>(&'a [(); 100]); 6 | 7 | fn test(x: Foo<'_>) {} 8 | //~^ needless_pass_by_value 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/crashes/regressions.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(clippy::disallowed_names, clippy::uninlined_format_args)] 4 | 5 | pub fn foo(bar: *const u8) { 6 | println!("{:#p}", bar); 7 | } 8 | 9 | // Regression test for https://github.com/rust-lang/rust-clippy/issues/4917 10 | /// n, 10 | _ => panic!("typeck error"), 11 | }; 12 | assert_eq!(n, 43); 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/third-party/clippy.toml: -------------------------------------------------------------------------------- 1 | # this is ignored by Clippy, but allowed for other tools like clippy-service 2 | [third-party] 3 | clippy-feature = "nightly" 4 | -------------------------------------------------------------------------------- /tests/ui/crashes/third-party/conf_allowlisted.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/ui/crashes/trivial_bounds.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![feature(trivial_bounds)] 4 | #![allow(unused, trivial_bounds)] 5 | 6 | fn test_trivial_bounds() 7 | where 8 | i32: Iterator, 9 | { 10 | for _ in 2i32 {} 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/crashes/unreachable-array-or-slice.rs: -------------------------------------------------------------------------------- 1 | struct Foo(isize, isize, isize, isize); 2 | 3 | pub fn main() { 4 | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); 5 | //~^ ERROR: failed to resolve 6 | match [5, 5, 5, 5] { 7 | [..] => {}, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/crate_level_checks/entrypoint_recursion.rs: -------------------------------------------------------------------------------- 1 | //@check-pass 2 | //@ignore-target: apple 3 | 4 | #![feature(rustc_attrs)] 5 | 6 | #[warn(clippy::main_recursion)] 7 | #[allow(unconditional_recursion)] 8 | #[rustc_main] 9 | fn a() { 10 | println!("Hello, World!"); 11 | a(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/crate_level_checks/no_std_swap.fixed: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![crate_type = "lib"] 3 | 4 | use core::panic::PanicInfo; 5 | 6 | pub fn main() { 7 | let mut a = 42; 8 | let mut b = 1337; 9 | 10 | core::mem::swap(&mut a, &mut b); 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/crate_level_checks/no_std_swap.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![crate_type = "lib"] 3 | 4 | use core::panic::PanicInfo; 5 | 6 | pub fn main() { 7 | let mut a = 42; 8 | let mut b = 1337; 9 | 10 | a = b; 11 | //~^ almost_swapped 12 | 13 | b = a; 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/crate_level_checks/std_main_recursion.rs: -------------------------------------------------------------------------------- 1 | #[warn(clippy::main_recursion)] 2 | #[allow(unconditional_recursion)] 3 | fn main() { 4 | println!("Hello, World!"); 5 | main(); 6 | //~^ main_recursion 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/create_dir.fixed: -------------------------------------------------------------------------------- 1 | #![allow(unused_must_use)] 2 | #![warn(clippy::create_dir)] 3 | 4 | use std::fs::create_dir_all; 5 | 6 | fn create_dir() {} 7 | 8 | fn main() { 9 | // Should be warned 10 | create_dir_all("foo"); 11 | //~^ create_dir 12 | create_dir_all("bar").unwrap(); 13 | //~^ create_dir 14 | 15 | // Shouldn't be warned 16 | create_dir(); 17 | std::fs::create_dir_all("foobar"); 18 | } 19 | -------------------------------------------------------------------------------- /tests/ui/create_dir.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_must_use)] 2 | #![warn(clippy::create_dir)] 3 | 4 | use std::fs::create_dir_all; 5 | 6 | fn create_dir() {} 7 | 8 | fn main() { 9 | // Should be warned 10 | std::fs::create_dir("foo"); 11 | //~^ create_dir 12 | std::fs::create_dir("bar").unwrap(); 13 | //~^ create_dir 14 | 15 | // Shouldn't be warned 16 | create_dir(); 17 | std::fs::create_dir_all("foobar"); 18 | } 19 | -------------------------------------------------------------------------------- /tests/ui/dbg_macro/auxiliary/submodule.rs: -------------------------------------------------------------------------------- 1 | fn f() { 2 | dbg!(); 3 | } 4 | -------------------------------------------------------------------------------- /tests/ui/dbg_macro/dbg_macro_unfixable.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix: overlapping suggestions 2 | //@error-in-other-file: 3 | #![warn(clippy::dbg_macro)] 4 | 5 | #[path = "auxiliary/submodule.rs"] 6 | mod submodule; 7 | 8 | fn main() { 9 | dbg!(dbg!(dbg!(42))); 10 | //~^ dbg_macro 11 | //~| dbg_macro 12 | //~| dbg_macro 13 | 14 | dbg!(1, 2, dbg!(3, 4)); 15 | //~^ dbg_macro 16 | //~| dbg_macro 17 | } 18 | -------------------------------------------------------------------------------- /tests/ui/deref_addrof_macro.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build:proc_macros.rs 3 | 4 | #![warn(clippy::deref_addrof)] 5 | 6 | extern crate proc_macros; 7 | 8 | #[proc_macros::inline_macros] 9 | fn f() -> i32 { 10 | // should be fine 11 | *inline!(&$1) 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /tests/ui/doc/footnote_issue_13183.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // This is a regression test for . 3 | // It should not warn on missing backticks on footnote references. 4 | 5 | #![warn(clippy::doc_markdown)] 6 | // Should not warn! 7 | //! Here's a footnote[^example_footnote_identifier] 8 | //! 9 | //! [^example_footnote_identifier]: This is merely an example. 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_10262.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | // Should only warn for the first line! 4 | /// `AviSynth` documentation: 5 | //~^ ERROR: item in documentation is missing backticks 6 | /// 7 | /// > AvisynthPluginInit3 may be called more than once with different IScriptEnvironments. 8 | /// 9 | ///
bla AvisynthPluginInit3 bla
10 | /// 11 | /// bla AvisynthPluginInit3 bla 12 | pub struct Foo; 13 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_10262.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | // Should only warn for the first line! 4 | /// AviSynth documentation: 5 | //~^ ERROR: item in documentation is missing backticks 6 | /// 7 | /// > AvisynthPluginInit3 may be called more than once with different IScriptEnvironments. 8 | /// 9 | ///
bla AvisynthPluginInit3 bla
10 | /// 11 | /// bla AvisynthPluginInit3 bla 12 | pub struct Foo; 13 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_12795.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | //! A comment with `a_b(x)` and `a_c` in it and (`a_b((c))` ) too and (maybe `a_b((c))`) 4 | //~^ doc_markdown 5 | //~| doc_markdown 6 | //~| doc_markdown 7 | //~| doc_markdown 8 | 9 | pub fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_12795.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) 4 | //~^ doc_markdown 5 | //~| doc_markdown 6 | //~| doc_markdown 7 | //~| doc_markdown 8 | 9 | pub fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_1832.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | /// Ok: 3 | /// 4 | /// Not ok: http://www.unicode.org 5 | /// Not ok: https://www.unicode.org 6 | /// Not ok: http://www.unicode.org/ 7 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels 8 | fn issue_1832() {} 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_902.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | /// See [NIST SP 800-56A, revision 2]. 3 | /// 4 | /// [NIST SP 800-56A, revision 2]: 5 | /// https://github.com/rust-lang/rust-clippy/issues/902#issuecomment-261919419 6 | fn issue_902_comment() {} 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_9473.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | // Should not warn! 4 | /// Blah blah blah [FooBar]<[FooBar]>. 5 | pub struct Foo(u32); 6 | 7 | // Should warn. 8 | /// Blah blah blah [FooBar]<[FooBar]>[`FooBar`]. 9 | //~^ doc_markdown 10 | pub struct FooBar(u32); 11 | -------------------------------------------------------------------------------- /tests/ui/doc/issue_9473.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::doc_markdown)] 2 | 3 | // Should not warn! 4 | /// Blah blah blah [FooBar]<[FooBar]>. 5 | pub struct Foo(u32); 6 | 7 | // Should warn. 8 | /// Blah blah blah [FooBar]<[FooBar]>[FooBar]. 9 | //~^ doc_markdown 10 | pub struct FooBar(u32); 11 | -------------------------------------------------------------------------------- /tests/ui/drain_collect_nostd.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::drain_collect)] 2 | #![no_std] 3 | extern crate alloc; 4 | use alloc::vec::Vec; 5 | 6 | fn remove_all(v: &mut Vec) -> Vec { 7 | core::mem::take(v) 8 | //~^ drain_collect 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/drain_collect_nostd.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::drain_collect)] 2 | #![no_std] 3 | extern crate alloc; 4 | use alloc::vec::Vec; 5 | 6 | fn remove_all(v: &mut Vec) -> Vec { 7 | v.drain(..).collect() 8 | //~^ drain_collect 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/duplicate_underscore_argument.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::duplicate_underscore_argument)] 2 | 3 | fn join_the_dark_side(darth: i32, _darth: i32) {} 4 | //~^ duplicate_underscore_argument 5 | 6 | fn join_the_light_side(knight: i32, _master: i32) {} // the Force is strong with this one 7 | 8 | fn main() { 9 | join_the_dark_side(0, 0); 10 | join_the_light_side(0, 0); 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/empty_drop.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::empty_drop)] 2 | #![allow(unused)] 3 | 4 | // should cause an error 5 | struct Foo; 6 | 7 | 8 | // shouldn't cause an error 9 | struct Bar; 10 | 11 | impl Drop for Bar { 12 | fn drop(&mut self) { 13 | println!("dropping bar!"); 14 | } 15 | } 16 | 17 | // should error 18 | struct Baz; 19 | 20 | 21 | fn main() {} 22 | -------------------------------------------------------------------------------- /tests/ui/empty_enum.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![warn(clippy::empty_enum)] 3 | // Enable never type to test empty enum lint 4 | #![feature(never_type)] 5 | enum Empty {} 6 | //~^ empty_enum 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/empty_enum_without_never_type.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(dead_code)] 4 | #![warn(clippy::empty_enum)] 5 | 6 | // `never_type` is not enabled; this test has no stderr file 7 | enum Empty {} 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /tests/ui/empty_loop_no_std.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Clink-arg=-nostartfiles 2 | //@ignore-target: apple 3 | 4 | #![warn(clippy::empty_loop)] 5 | #![crate_type = "lib"] 6 | #![no_std] 7 | 8 | pub fn main(argc: isize, argv: *const *const u8) -> isize { 9 | // This should trigger the lint 10 | loop {} 11 | //~^ empty_loop 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/entry_btree.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::map_entry)] 2 | #![allow(dead_code)] 3 | 4 | use std::collections::BTreeMap; 5 | 6 | fn foo() {} 7 | 8 | fn btree_map(m: &mut BTreeMap, k: K, v: V) { 9 | // insert then do something, use if let 10 | if !m.contains_key(&k) { 11 | //~^ map_entry 12 | m.insert(k, v); 13 | foo(); 14 | } 15 | } 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /tests/ui/eta_nostd.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::redundant_closure)] 2 | #![no_std] 3 | 4 | extern crate alloc; 5 | use alloc::vec; 6 | use alloc::vec::Vec; 7 | 8 | fn issue_13895() { 9 | let _: Option> = true.then(alloc::vec::Vec::new); 10 | //~^ redundant_closure 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/eta_nostd.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::redundant_closure)] 2 | #![no_std] 3 | 4 | extern crate alloc; 5 | use alloc::vec; 6 | use alloc::vec::Vec; 7 | 8 | fn issue_13895() { 9 | let _: Option> = true.then(|| vec![]); 10 | //~^ redundant_closure 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/exit1.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::exit)] 2 | 3 | fn not_main() { 4 | if true { 5 | std::process::exit(4); 6 | //~^ exit 7 | } 8 | } 9 | 10 | fn main() { 11 | if true { 12 | std::process::exit(2); 13 | }; 14 | not_main(); 15 | std::process::exit(1); 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/exit1.stderr: -------------------------------------------------------------------------------- 1 | error: usage of `process::exit` 2 | --> tests/ui/exit1.rs:5:9 3 | | 4 | LL | std::process::exit(4); 5 | | ^^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = note: `-D clippy::exit` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::exit)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/exit2.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::exit)] 2 | 3 | fn also_not_main() { 4 | std::process::exit(3); 5 | //~^ exit 6 | } 7 | 8 | fn main() { 9 | if true { 10 | std::process::exit(2); 11 | }; 12 | also_not_main(); 13 | std::process::exit(1); 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/exit2.stderr: -------------------------------------------------------------------------------- 1 | error: usage of `process::exit` 2 | --> tests/ui/exit2.rs:4:5 3 | | 4 | LL | std::process::exit(3); 5 | | ^^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = note: `-D clippy::exit` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::exit)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/exit3.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::exit)] 4 | 5 | fn main() { 6 | if true { 7 | std::process::exit(2); 8 | }; 9 | std::process::exit(1); 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/flat_map_option.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::flat_map_option)] 2 | #![allow(clippy::redundant_closure, clippy::unnecessary_filter_map)] 3 | 4 | fn main() { 5 | // yay 6 | let c = |x| Some(x); 7 | let _ = [1].iter().filter_map(c); 8 | //~^ flat_map_option 9 | let _ = [1].iter().filter_map(Some); 10 | //~^ flat_map_option 11 | 12 | // nay 13 | let _ = [1].iter().flat_map(|_| &Some(1)); 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/flat_map_option.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::flat_map_option)] 2 | #![allow(clippy::redundant_closure, clippy::unnecessary_filter_map)] 3 | 4 | fn main() { 5 | // yay 6 | let c = |x| Some(x); 7 | let _ = [1].iter().flat_map(c); 8 | //~^ flat_map_option 9 | let _ = [1].iter().flat_map(Some); 10 | //~^ flat_map_option 11 | 12 | // nay 13 | let _ = [1].iter().flat_map(|_| &Some(1)); 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/four_forward_slashes_first_line.fixed: -------------------------------------------------------------------------------- 1 | /// borked doc comment on the first line. doesn't combust! 2 | //~^ four_forward_slashes 3 | fn a() {} 4 | 5 | // This test's entire purpose is to make sure we don't panic if the comment with four slashes 6 | // extends to the first line of the file. This is likely pretty rare in production, but an ICE is an 7 | // ICE. 8 | -------------------------------------------------------------------------------- /tests/ui/four_forward_slashes_first_line.rs: -------------------------------------------------------------------------------- 1 | //// borked doc comment on the first line. doesn't combust! 2 | //~^ four_forward_slashes 3 | fn a() {} 4 | 5 | // This test's entire purpose is to make sure we don't panic if the comment with four slashes 6 | // extends to the first line of the file. This is likely pretty rare in production, but an ICE is an 7 | // ICE. 8 | -------------------------------------------------------------------------------- /tests/ui/if_not_else_bittest.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![deny(clippy::if_not_else)] 4 | 5 | fn show_permissions(flags: u32) { 6 | if flags & 0x0F00 != 0 { 7 | println!("Has the 0x0F00 permission."); 8 | } else { 9 | println!("The 0x0F00 permission is missing."); 10 | } 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /tests/ui/ignore_without_reason.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::ignore_without_reason)] 2 | 3 | fn main() {} 4 | 5 | #[test] 6 | fn unignored_test() {} 7 | 8 | #[test] 9 | #[ignore = "Some good reason"] 10 | fn ignored_with_reason() {} 11 | 12 | #[test] 13 | #[ignore] //~ ignore_without_reason 14 | fn ignored_without_reason() {} 15 | -------------------------------------------------------------------------------- /tests/ui/ignore_without_reason.stderr: -------------------------------------------------------------------------------- 1 | error: `#[ignore]` without reason 2 | --> tests/ui/ignore_without_reason.rs:13:1 3 | | 4 | LL | #[ignore] 5 | | ^^^^^^^^^ 6 | | 7 | = help: add a reason with `= ".."` 8 | = note: `-D clippy::ignore-without-reason` implied by `-D warnings` 9 | = help: to override `-D warnings` add `#[allow(clippy::ignore_without_reason)]` 10 | 11 | error: aborting due to 1 previous error 12 | 13 | -------------------------------------------------------------------------------- /tests/ui/inline_fn_without_body.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::inline_fn_without_body)] 2 | #![allow(clippy::inline_always)] 3 | 4 | trait Foo { 5 | //~^ inline_fn_without_body 6 | fn default_inline(); 7 | 8 | //~^ inline_fn_without_body 9 | fn always_inline(); 10 | 11 | //~^ inline_fn_without_body 12 | fn never_inline(); 13 | 14 | #[inline] 15 | fn has_body() {} 16 | } 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/ui/issue-111399.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![feature(inherent_associated_types)] 4 | #![allow(incomplete_features)] 5 | 6 | // Check that rustc doesn't crash on the trait bound `Self::Ty: std::marker::Freeze`. 7 | 8 | pub struct Struct; 9 | 10 | impl Struct { 11 | pub type Ty = usize; 12 | pub const CT: Self::Ty = 42; 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /tests/ui/issue-3145.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("{}" a); //~ERROR: expected `,`, found `a` 3 | } 4 | -------------------------------------------------------------------------------- /tests/ui/issue-3145.stderr: -------------------------------------------------------------------------------- 1 | error: expected `,`, found `a` 2 | --> tests/ui/issue-3145.rs:2:19 3 | | 4 | LL | println!("{}" a); 5 | | ^ expected `,` 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui/items_after_test_module/after_proc_macros.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build:../auxiliary/proc_macros.rs 3 | extern crate proc_macros; 4 | 5 | proc_macros::with_span! { 6 | span 7 | #[cfg(test)] 8 | mod tests {} 9 | } 10 | 11 | #[test] 12 | fn f() {} 13 | -------------------------------------------------------------------------------- /tests/ui/items_after_test_module/auxiliary/submodule.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests {} 3 | 4 | fn in_submodule() {} 5 | -------------------------------------------------------------------------------- /tests/ui/items_after_test_module/auxiliary/tests.rs: -------------------------------------------------------------------------------- 1 | fn main() {} 2 | -------------------------------------------------------------------------------- /tests/ui/items_after_test_module/in_submodule.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: 2 | #[path = "auxiliary/submodule.rs"] 3 | mod submodule; 4 | 5 | #[cfg(test)] 6 | mod tests { 7 | #[test] 8 | fn t() {} 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/items_after_test_module/multiple_modules.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #[cfg(test)] 4 | mod tests { 5 | #[test] 6 | fn f() {} 7 | } 8 | 9 | #[cfg(test)] 10 | mod more_tests { 11 | #[test] 12 | fn g() {} 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/map_unit_fn.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![allow(unused)] 4 | struct Mappable; 5 | 6 | impl Mappable { 7 | pub fn map(&self) {} 8 | } 9 | 10 | fn main() { 11 | let m = Mappable {}; 12 | m.map(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/map_with_unused_argument_over_ranges_nostd.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::map_with_unused_argument_over_ranges)] 2 | #![no_std] 3 | extern crate alloc; 4 | use alloc::vec::Vec; 5 | 6 | fn nostd(v: &mut [i32]) { 7 | let _: Vec<_> = core::iter::repeat_n(3 + 1, 10).collect(); 8 | //~^ map_with_unused_argument_over_ranges 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/map_with_unused_argument_over_ranges_nostd.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::map_with_unused_argument_over_ranges)] 2 | #![no_std] 3 | extern crate alloc; 4 | use alloc::vec::Vec; 5 | 6 | fn nostd(v: &mut [i32]) { 7 | let _: Vec<_> = (0..10).map(|_| 3 + 1).collect(); 8 | //~^ map_with_unused_argument_over_ranges 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/methods_fixable.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::filter_next)] 2 | #![allow(clippy::useless_vec)] 3 | 4 | /// Checks implementation of `FILTER_NEXT` lint. 5 | fn main() { 6 | let v = vec![3, 2, 1, 0, -1, -2, -3]; 7 | 8 | // Single-line case. 9 | let _ = v.iter().find(|&x| *x < 0); 10 | //~^ filter_next 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/methods_fixable.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::filter_next)] 2 | #![allow(clippy::useless_vec)] 3 | 4 | /// Checks implementation of `FILTER_NEXT` lint. 5 | fn main() { 6 | let v = vec![3, 2, 1, 0, -1, -2, -3]; 7 | 8 | // Single-line case. 9 | let _ = v.iter().filter(|&x| *x < 0).next(); 10 | //~^ filter_next 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/methods_unfixable.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::filter_next)] 2 | //@no-rustfix 3 | fn main() { 4 | issue10029(); 5 | } 6 | 7 | pub fn issue10029() { 8 | let iter = (0..10); 9 | let _ = iter.filter(|_| true).next(); 10 | //~^ filter_next 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/missing_const_for_fn/auxiliary/helper.rs: -------------------------------------------------------------------------------- 1 | // This file provides a const function that is unstably const forever. 2 | 3 | #![feature(staged_api)] 4 | #![stable(feature = "clippytest", since = "1.0.0")] 5 | 6 | #[stable(feature = "clippytest", since = "1.0.0")] 7 | #[rustc_const_unstable(feature = "foo", issue = "none")] 8 | pub const fn unstably_const_fn() {} 9 | -------------------------------------------------------------------------------- /tests/ui/missing_doc_crate.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::missing_docs_in_private_items)] 4 | #![allow(clippy::doc_include_without_cfg)] 5 | #![doc = include_str!("../../README.md")] 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui/missing_doc_crate_missing.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::missing_docs_in_private_items)] 2 | //~^ missing_docs_in_private_items 3 | 4 | fn main() {} 5 | -------------------------------------------------------------------------------- /tests/ui/missing_inline_executable.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::missing_inline_in_public_items)] 4 | 5 | pub fn foo() {} 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /tests/ui/mixed_attributes_style/auxiliary/submodule.rs: -------------------------------------------------------------------------------- 1 | //! Module level doc 2 | 3 | #![allow(dead_code)] 4 | 5 | #[allow(unused)] 6 | mod foo { 7 | #![allow(dead_code)] 8 | } 9 | -------------------------------------------------------------------------------- /tests/ui/mixed_attributes_style/global_allow.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-clippy/issues/12436 2 | //@check-pass 3 | #![allow(clippy::mixed_attributes_style)] 4 | 5 | #[path = "auxiliary/submodule.rs"] 6 | mod submodule; 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /tests/ui/mixed_attributes_style/mod_declaration.rs: -------------------------------------------------------------------------------- 1 | //@error-in-other-file: item has both inner and outer attributes 2 | //@no-rustfix 3 | #[path = "auxiliary/submodule.rs"] // don't lint. 4 | /// This doc comment should not lint, it could be used to add context to the original module doc 5 | mod submodule; 6 | -------------------------------------------------------------------------------- /tests/ui/must_use_unit_unfixable.rs: -------------------------------------------------------------------------------- 1 | //@no-rustfix 2 | 3 | #[cfg_attr(all(), must_use, deprecated)] 4 | fn issue_12320() {} 5 | //~^ must_use_unit 6 | 7 | #[cfg_attr(all(), deprecated, doc = "foo", must_use)] 8 | fn issue_12320_2() {} 9 | //~^ must_use_unit 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/needless_else.stderr: -------------------------------------------------------------------------------- 1 | error: this `else` branch is empty 2 | --> tests/ui/needless_else.rs:23:7 3 | | 4 | LL | } else { 5 | | _______^ 6 | LL | | } 7 | | |_____^ help: you can remove it 8 | | 9 | = note: `-D clippy::needless-else` implied by `-D warnings` 10 | = help: to override `-D warnings` add `#[allow(clippy::needless_else)]` 11 | 12 | error: aborting due to 1 previous error 13 | 14 | -------------------------------------------------------------------------------- /tests/ui/needless_pass_by_ref_mut_2021.rs: -------------------------------------------------------------------------------- 1 | //@edition: 2021 2 | //@check-pass 3 | #![warn(clippy::needless_pass_by_ref_mut)] 4 | 5 | struct Data { 6 | value: T, 7 | } 8 | 9 | // Unsafe functions should not warn. 10 | unsafe fn get_mut_unchecked(ptr: &mut std::ptr::NonNull>) -> &mut T { 11 | &mut (*ptr.as_ptr()).value 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/new_ret_no_self_overflow.stderr: -------------------------------------------------------------------------------- 1 | error[E0275]: overflow evaluating the requirement `::Output == issue10041::X` 2 | --> tests/ui/new_ret_no_self_overflow.rs:21:25 3 | | 4 | LL | pub fn new() -> X { 5 | | ^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | For more information about this error, try `rustc --explain E0275`. 10 | -------------------------------------------------------------------------------- /tests/ui/non_expressive_names_error_recovery.fixed: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-clippy/issues/12302 2 | use std::marker::PhantomData; 3 | 4 | pub struct Aa(PhantomData); 5 | 6 | fn aa(a: Aa) { 7 | //~^ ERROR: expected one of 8 | 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/non_expressive_names_error_recovery.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/rust-lang/rust-clippy/issues/12302 2 | use std::marker::PhantomData; 3 | 4 | pub struct Aa(PhantomData); 5 | 6 | fn aa(a: Aa tests/ui/non_minimal_cfg2.rs:4:7 3 | | 4 | LL | #[cfg(all())] 5 | | ^^^^^ 6 | | 7 | = note: `-D clippy::non-minimal-cfg` implied by `-D warnings` 8 | = help: to override `-D warnings` add `#[allow(clippy::non_minimal_cfg)]` 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/non_std_lazy_static/non_std_lazy_static_other_once_cell.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | //@aux-build:once_cell.rs 3 | 4 | #![warn(clippy::non_std_lazy_statics)] 5 | 6 | // Should not error, since we used a type besides `sync::Lazy` 7 | fn use_once_cell_race(x: once_cell::race::OnceBox) { 8 | let _foo = x.get(); 9 | } 10 | 11 | use once_cell::sync::Lazy; 12 | 13 | static LAZY_BAZ: Lazy = Lazy::new(|| "baz".to_uppercase()); 14 | -------------------------------------------------------------------------------- /tests/ui/nonminimal_bool_methods_unfixable.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::nonminimal_bool)] 2 | //@no-rustfix 3 | 4 | fn issue_13436() { 5 | let opt_opt = Some(Some(500)); 6 | _ = !opt_opt.is_some_and(|x| !x.is_some_and(|y| y != 1000)); 7 | //~^ nonminimal_bool 8 | //~| nonminimal_bool 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/open_options_fixable.fixed: -------------------------------------------------------------------------------- 1 | use std::fs::OpenOptions; 2 | #[allow(unused_must_use)] 3 | #[warn(clippy::suspicious_open_options)] 4 | fn main() { 5 | OpenOptions::new().create(true).truncate(true).open("foo.txt"); 6 | //~^ suspicious_open_options 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/open_options_fixable.rs: -------------------------------------------------------------------------------- 1 | use std::fs::OpenOptions; 2 | #[allow(unused_must_use)] 3 | #[warn(clippy::suspicious_open_options)] 4 | fn main() { 5 | OpenOptions::new().create(true).open("foo.txt"); 6 | //~^ suspicious_open_options 7 | } 8 | -------------------------------------------------------------------------------- /tests/ui/out_of_bounds_indexing/issue-3102.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::out_of_bounds_indexing)] 2 | #![allow(clippy::no_effect)] 3 | 4 | fn main() { 5 | let x = [1, 2, 3, 4]; 6 | 7 | // issue 3102 8 | let num = 1; 9 | &x[num..10]; 10 | //~^ out_of_bounds_indexing 11 | 12 | &x[10..num]; 13 | //~^ out_of_bounds_indexing 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/path_buf_push_overwrite.fixed: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | #[warn(clippy::path_buf_push_overwrite)] 4 | #[allow(clippy::pathbuf_init_then_push)] 5 | fn main() { 6 | let mut x = PathBuf::from("/foo"); 7 | x.push("bar"); 8 | //~^ path_buf_push_overwrite 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/path_buf_push_overwrite.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | #[warn(clippy::path_buf_push_overwrite)] 4 | #[allow(clippy::pathbuf_init_then_push)] 5 | fn main() { 6 | let mut x = PathBuf::from("/foo"); 7 | x.push("/bar"); 8 | //~^ path_buf_push_overwrite 9 | } 10 | -------------------------------------------------------------------------------- /tests/ui/print_stderr.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::print_stderr)] 2 | 3 | fn main() { 4 | eprintln!("Hello"); 5 | //~^ print_stderr 6 | 7 | println!("This should not do anything"); 8 | eprint!("World"); 9 | //~^ print_stderr 10 | 11 | print!("Nor should this"); 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/print_stdout_build_script.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: --crate-name=build_script_build 2 | //@ check-pass 3 | 4 | #![warn(clippy::print_stdout)] 5 | 6 | fn main() { 7 | // Fix #6041 8 | // 9 | // The `print_stdout` lint shouldn't emit in `build.rs` 10 | // as these methods are used for the build script. 11 | println!("Hello"); 12 | print!("Hello"); 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/proc_macro.stderr: -------------------------------------------------------------------------------- 1 | error: approximate value of `f{32, 64}::consts::PI` found 2 | --> tests/ui/proc_macro.rs:9:14 3 | | 4 | LL | let _x = 3.14; 5 | | ^^^^ 6 | | 7 | = help: consider using the constant directly 8 | = note: `#[deny(clippy::approx_constant)]` on by default 9 | 10 | error: aborting due to 1 previous error 11 | 12 | -------------------------------------------------------------------------------- /tests/ui/pub_use.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::pub_use)] 2 | #![allow(unused_imports)] 3 | #![no_main] 4 | 5 | pub mod outer { 6 | mod inner { 7 | pub struct Test {} 8 | } 9 | // should be linted 10 | pub use inner::Test; 11 | //~^ pub_use 12 | } 13 | 14 | // should not be linted 15 | use std::fmt; 16 | -------------------------------------------------------------------------------- /tests/ui/pub_use.stderr: -------------------------------------------------------------------------------- 1 | error: using `pub use` 2 | --> tests/ui/pub_use.rs:10:5 3 | | 4 | LL | pub use inner::Test; 5 | | ^^^^^^^^^^^^^^^^^^^^ 6 | | 7 | = help: move the exported item to a public module instead 8 | = note: `-D clippy::pub-use` implied by `-D warnings` 9 | = help: to override `-D warnings` add `#[allow(clippy::pub_use)]` 10 | 11 | error: aborting due to 1 previous error 12 | 13 | -------------------------------------------------------------------------------- /tests/ui/question_mark_used.rs: -------------------------------------------------------------------------------- 1 | // non rustfixable 2 | #![allow(unreachable_code)] 3 | #![allow(dead_code)] 4 | #![warn(clippy::question_mark_used)] 5 | 6 | fn other_function() -> Option { 7 | Some(32) 8 | } 9 | 10 | fn my_function() -> Option { 11 | other_function()?; 12 | //~^ question_mark_used 13 | 14 | None 15 | } 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /tests/ui/rc_buffer_redefined_string.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::rc_buffer)] 4 | 5 | use std::rc::Rc; 6 | 7 | struct String; 8 | 9 | struct S { 10 | // does not trigger lint 11 | good1: Rc, 12 | } 13 | 14 | fn main() {} 15 | -------------------------------------------------------------------------------- /tests/ui/ref_option/all/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = false 2 | -------------------------------------------------------------------------------- /tests/ui/ref_option/private/clippy.toml: -------------------------------------------------------------------------------- 1 | avoid-breaking-exported-api = true 2 | -------------------------------------------------------------------------------- /tests/ui/renamed_builtin_attr.fixed: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Zdeduplicate-diagnostics=yes 2 | 3 | #[clippy::cognitive_complexity = "1"] 4 | //~^ ERROR: usage of deprecated attribute 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui/renamed_builtin_attr.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Zdeduplicate-diagnostics=yes 2 | 3 | #[clippy::cyclomatic_complexity = "1"] 4 | //~^ ERROR: usage of deprecated attribute 5 | fn main() {} 6 | -------------------------------------------------------------------------------- /tests/ui/renamed_builtin_attr.stderr: -------------------------------------------------------------------------------- 1 | error: usage of deprecated attribute 2 | --> tests/ui/renamed_builtin_attr.rs:3:11 3 | | 4 | LL | #[clippy::cyclomatic_complexity = "1"] 5 | | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `cognitive_complexity` 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui/repeat_vec_with_capacity_nostd.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::repeat_vec_with_capacity)] 2 | #![allow(clippy::manual_repeat_n)] 3 | #![no_std] 4 | use core::iter; 5 | extern crate alloc; 6 | use alloc::vec::Vec; 7 | 8 | fn nostd() { 9 | let _: Vec> = core::iter::repeat_with(|| Vec::with_capacity(42)).take(123).collect(); 10 | //~^ repeat_vec_with_capacity 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/repeat_vec_with_capacity_nostd.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::repeat_vec_with_capacity)] 2 | #![allow(clippy::manual_repeat_n)] 3 | #![no_std] 4 | use core::iter; 5 | extern crate alloc; 6 | use alloc::vec::Vec; 7 | 8 | fn nostd() { 9 | let _: Vec> = iter::repeat(Vec::with_capacity(42)).take(123).collect(); 10 | //~^ repeat_vec_with_capacity 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/reversed_empty_ranges_loops_unfixable.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::reversed_empty_ranges)] 2 | #![allow(clippy::uninlined_format_args)] 3 | 4 | fn main() { 5 | for i in 5..5 { 6 | //~^ reversed_empty_ranges 7 | 8 | println!("{}", i); 9 | } 10 | 11 | for i in (5 + 2)..(8 - 1) { 12 | //~^ reversed_empty_ranges 13 | 14 | println!("{}", i); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/search_is_some_fixable_some_2021.fixed: -------------------------------------------------------------------------------- 1 | //@edition: 2021 2 | #![warn(clippy::search_is_some)] 3 | 4 | fn main() { 5 | fn ref_bindings() { 6 | let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().any(|(&x, y)| x == *y); 7 | //~^ search_is_some 8 | let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().any(|(&x, y)| x == *y); 9 | //~^ search_is_some 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/search_is_some_fixable_some_2021.rs: -------------------------------------------------------------------------------- 1 | //@edition: 2021 2 | #![warn(clippy::search_is_some)] 3 | 4 | fn main() { 5 | fn ref_bindings() { 6 | let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().find(|(&x, y)| x == *y).is_some(); 7 | //~^ search_is_some 8 | let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().find(|&(&x, y)| x == *y).is_some(); 9 | //~^ search_is_some 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/single_component_path_imports_self_after.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::single_component_path_imports)] 4 | #![allow(unused_imports)] 5 | 6 | use self::regex::{Regex as xeger, RegexSet as tesxeger}; 7 | #[rustfmt::skip] 8 | pub use self::{ 9 | regex::{Regex, RegexSet}, 10 | some_mod::SomeType, 11 | }; 12 | use regex; 13 | 14 | mod some_mod { 15 | pub struct SomeType; 16 | } 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /tests/ui/single_component_path_imports_self_before.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![warn(clippy::single_component_path_imports)] 4 | #![allow(unused_imports)] 5 | 6 | use regex; 7 | 8 | use self::regex::{Regex as xeger, RegexSet as tesxeger}; 9 | #[rustfmt::skip] 10 | pub use self::{ 11 | regex::{Regex, RegexSet}, 12 | some_mod::SomeType, 13 | }; 14 | 15 | mod some_mod { 16 | pub struct SomeType; 17 | } 18 | 19 | fn main() {} 20 | -------------------------------------------------------------------------------- /tests/ui/str_to_string.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::str_to_string)] 2 | 3 | fn main() { 4 | let hello = "hello world".to_owned(); 5 | //~^ str_to_string 6 | 7 | let msg = &hello[..]; 8 | msg.to_owned(); 9 | //~^ str_to_string 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/str_to_string.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::str_to_string)] 2 | 3 | fn main() { 4 | let hello = "hello world".to_string(); 5 | //~^ str_to_string 6 | 7 | let msg = &hello[..]; 8 | msg.to_string(); 9 | //~^ str_to_string 10 | } 11 | -------------------------------------------------------------------------------- /tests/ui/string_from_utf8_as_bytes.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::string_from_utf8_as_bytes)] 2 | 3 | fn main() { 4 | let _ = Some(&"Hello World!"[6..11]); 5 | //~^ string_from_utf8_as_bytes 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/string_from_utf8_as_bytes.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::string_from_utf8_as_bytes)] 2 | 3 | fn main() { 4 | let _ = std::str::from_utf8(&"Hello World!".as_bytes()[6..11]); 5 | //~^ string_from_utf8_as_bytes 6 | } 7 | -------------------------------------------------------------------------------- /tests/ui/suspicious_doc_comments_unfixable.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused, clippy::empty_line_after_doc_comments)] 2 | #![warn(clippy::suspicious_doc_comments)] 3 | //@no-rustfix 4 | ///! a 5 | //~^ suspicious_doc_comments 6 | 7 | ///! b 8 | /// c 9 | ///! d 10 | pub fn foo() {} 11 | 12 | ///! a 13 | //~^ suspicious_doc_comments 14 | 15 | ///! b 16 | /// c 17 | ///! d 18 | use std::mem; 19 | 20 | fn main() {} 21 | -------------------------------------------------------------------------------- /tests/ui/to_string_in_format_args_incremental.fixed: -------------------------------------------------------------------------------- 1 | //@compile-flags: -C incremental=target/debug/test/incr 2 | 3 | #![allow(clippy::uninlined_format_args)] 4 | 5 | // see https://github.com/rust-lang/rust-clippy/issues/10969 6 | 7 | fn main() { 8 | let s = "Hello, world!"; 9 | println!("{}", s); 10 | //~^ to_string_in_format_args 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/to_string_in_format_args_incremental.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -C incremental=target/debug/test/incr 2 | 3 | #![allow(clippy::uninlined_format_args)] 4 | 5 | // see https://github.com/rust-lang/rust-clippy/issues/10969 6 | 7 | fn main() { 8 | let s = "Hello, world!"; 9 | println!("{}", s.to_string()); 10 | //~^ to_string_in_format_args 11 | } 12 | -------------------------------------------------------------------------------- /tests/ui/track-diagnostics.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Z track-diagnostics 2 | 3 | // Normalize the emitted location so this doesn't need 4 | // updating everytime someone adds or removes a line. 5 | //@normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC" 6 | 7 | struct A; 8 | struct B; 9 | const S: A = B; 10 | //~^ ERROR: mismatched types 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /tests/ui/track-diagnostics.stderr: -------------------------------------------------------------------------------- 1 | error[E0308]: mismatched types 2 | --> tests/ui/track-diagnostics.rs:LL:CC 3 | | 4 | LL | const S: A = B; 5 | | ^ expected `A`, found `B` 6 | -Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:LL:CC 7 | 8 | error: aborting due to 1 previous error 9 | 10 | For more information about this error, try `rustc --explain E0308`. 11 | -------------------------------------------------------------------------------- /tests/ui/trailing_zeros.fixed: -------------------------------------------------------------------------------- 1 | #![allow(unused_parens)] 2 | #![warn(clippy::verbose_bit_mask)] 3 | 4 | fn main() { 5 | let x: i32 = 42; 6 | let _ = x.trailing_zeros() >= 4; 7 | //~^ verbose_bit_mask 8 | 9 | let _ = x.trailing_zeros() >= 5; 10 | //~^ verbose_bit_mask 11 | 12 | let _ = x & 0b1_1010 == 0; // do not lint 13 | let _ = x & 1 == 0; // do not lint 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/trailing_zeros.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_parens)] 2 | #![warn(clippy::verbose_bit_mask)] 3 | 4 | fn main() { 5 | let x: i32 = 42; 6 | let _ = (x & 0b1111 == 0); 7 | //~^ verbose_bit_mask 8 | 9 | let _ = x & 0b1_1111 == 0; 10 | //~^ verbose_bit_mask 11 | 12 | let _ = x & 0b1_1010 == 0; // do not lint 13 | let _ = x & 1 == 0; // do not lint 14 | } 15 | -------------------------------------------------------------------------------- /tests/ui/transmute_64bit.rs: -------------------------------------------------------------------------------- 1 | //@ignore-bitwidth: 32 2 | 3 | #[warn(clippy::wrong_transmute)] 4 | fn main() { 5 | unsafe { 6 | let _: *const usize = std::mem::transmute(6.0f64); 7 | //~^ wrong_transmute 8 | 9 | let _: *mut usize = std::mem::transmute(6.0f64); 10 | //~^ wrong_transmute 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/ty_fn_sig.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | // Regression test 3 | 4 | pub fn retry(f: F) { 5 | for _i in 0.. { 6 | f(); 7 | } 8 | } 9 | 10 | fn main() { 11 | for y in 0..4 { 12 | let func = || (); 13 | func(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/ui/unknown_attribute.rs: -------------------------------------------------------------------------------- 1 | //@compile-flags: -Zdeduplicate-diagnostics=yes 2 | 3 | #[clippy::unknown] 4 | //~^ ERROR: usage of unknown attribute 5 | #[clippy::cognitive_complexity = "1"] 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /tests/ui/unknown_attribute.stderr: -------------------------------------------------------------------------------- 1 | error: usage of unknown attribute 2 | --> tests/ui/unknown_attribute.rs:3:11 3 | | 4 | LL | #[clippy::unknown] 5 | | ^^^^^^^ 6 | 7 | error: aborting due to 1 previous error 8 | 9 | -------------------------------------------------------------------------------- /tests/ui/unnecessary_self_imports.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unnecessary_self_imports)] 2 | #![allow(unused_imports, dead_code)] 3 | 4 | use std::collections::hash_map::{self, *}; 5 | use std::fs as alias; 6 | //~^ unnecessary_self_imports 7 | use std::io::{self, Read}; 8 | use std::rc; 9 | //~^ unnecessary_self_imports 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/unnecessary_self_imports.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::unnecessary_self_imports)] 2 | #![allow(unused_imports, dead_code)] 3 | 4 | use std::collections::hash_map::{self, *}; 5 | use std::fs::{self as alias}; 6 | //~^ unnecessary_self_imports 7 | use std::io::{self, Read}; 8 | use std::rc::{self}; 9 | //~^ unnecessary_self_imports 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /tests/ui/unwrap_or.fixed: -------------------------------------------------------------------------------- 1 | #![warn(clippy::or_fun_call)] 2 | #![allow(clippy::unnecessary_literal_unwrap)] 3 | 4 | fn main() { 5 | let s = Some(String::from("test string")).unwrap_or_else(|| "Fail".to_string()).len(); 6 | //~^ or_fun_call 7 | } 8 | 9 | fn new_lines() { 10 | let s = Some(String::from("test string")).unwrap_or_else(|| "Fail".to_string()).len(); 11 | //~^ or_fun_call 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/unwrap_or.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::or_fun_call)] 2 | #![allow(clippy::unnecessary_literal_unwrap)] 3 | 4 | fn main() { 5 | let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len(); 6 | //~^ or_fun_call 7 | } 8 | 9 | fn new_lines() { 10 | let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len(); 11 | //~^ or_fun_call 12 | } 13 | -------------------------------------------------------------------------------- /tests/ui/update-all-references.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Please use 'cargo bless' instead." 4 | -------------------------------------------------------------------------------- /tests/ui/useful_asref.rs: -------------------------------------------------------------------------------- 1 | //@ check-pass 2 | 3 | #![deny(clippy::useless_asref)] 4 | #![allow(clippy::needless_lifetimes)] 5 | 6 | trait Trait { 7 | fn as_ptr(&self); 8 | } 9 | 10 | impl<'a> Trait for &'a [u8] { 11 | fn as_ptr(&self) { 12 | self.as_ref().as_ptr(); 13 | } 14 | } 15 | 16 | fn main() {} 17 | -------------------------------------------------------------------------------- /tests/ui/while_float.rs: -------------------------------------------------------------------------------- 1 | #[deny(clippy::while_float)] 2 | fn main() { 3 | let mut x = 0.0_f32; 4 | while x < 42.0_f32 { 5 | //~^ while_float 6 | x += 0.5; 7 | } 8 | while x < 42.0 { 9 | //~^ while_float 10 | x += 1.0; 11 | } 12 | let mut x = 0; 13 | while x < 42 { 14 | x += 1; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/ui/zero_ptr_no_std.fixed: -------------------------------------------------------------------------------- 1 | #![crate_type = "lib"] 2 | #![no_std] 3 | #![deny(clippy::zero_ptr)] 4 | 5 | pub fn main(_argc: isize, _argv: *const *const u8) -> isize { 6 | let _ = core::ptr::null::(); 7 | //~^ zero_ptr 8 | let _ = core::ptr::null_mut::(); 9 | //~^ zero_ptr 10 | let _: *const u8 = core::ptr::null(); 11 | //~^ zero_ptr 12 | 0 13 | } 14 | -------------------------------------------------------------------------------- /tests/ui/zero_ptr_no_std.rs: -------------------------------------------------------------------------------- 1 | #![crate_type = "lib"] 2 | #![no_std] 3 | #![deny(clippy::zero_ptr)] 4 | 5 | pub fn main(_argc: isize, _argv: *const *const u8) -> isize { 6 | let _ = 0 as *const usize; 7 | //~^ zero_ptr 8 | let _ = 0 as *mut f64; 9 | //~^ zero_ptr 10 | let _: *const u8 = 0 as *const _; 11 | //~^ zero_ptr 12 | 0 13 | } 14 | -------------------------------------------------------------------------------- /tests/workspace_test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "workspace_test" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [workspace] 7 | members = ["subcrate", "module_style/pass_no_mod_with_dep_in_subdir", "module_style/pass_mod_with_dep_in_subdir"] 8 | -------------------------------------------------------------------------------- /tests/workspace_test/build.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::print_stdout)] 2 | 3 | fn main() { 4 | // Test for #6041 5 | println!("Hello"); 6 | print!("Hello"); 7 | } 8 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-mod-with-dep-in-subdir" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | dep-no-mod = { path = "dep_no_mod"} 11 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dep-no-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs: -------------------------------------------------------------------------------- 1 | pub mod hello; 2 | pub struct Thing; 3 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs: -------------------------------------------------------------------------------- 1 | pub struct Hello; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod foo; 2 | 3 | pub fn foo() { 4 | let _ = foo::Thing; 5 | } 6 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::self_named_module_files)] 2 | 3 | mod bad; 4 | mod more; 5 | extern crate dep_no_mod; 6 | 7 | fn main() { 8 | let _ = bad::Thing; 9 | let _ = more::foo::Foo; 10 | let _ = more::inner::Inner; 11 | let _ = dep_no_mod::foo::Thing; 12 | let _ = dep_no_mod::foo::hello::Hello; 13 | } 14 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/foo.rs: -------------------------------------------------------------------------------- 1 | pub struct Foo; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/inner/mod.rs: -------------------------------------------------------------------------------- 1 | pub struct Inner; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod foo; 2 | pub mod inner; 3 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pass-no-mod-with-dep-in-subdir" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | dep-with-mod = { path = "dep_with_mod"} 11 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dep-with-mod" 3 | version = "0.1.0" 4 | edition = "2018" 5 | publish = false 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod with_mod; 2 | 3 | pub fn foo() { 4 | let _ = with_mod::Thing; 5 | let _ = with_mod::inner::stuff::Inner; 6 | let _ = with_mod::inner::stuff::most::Snarks; 7 | } 8 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner.rs: -------------------------------------------------------------------------------- 1 | pub mod stuff; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff.rs: -------------------------------------------------------------------------------- 1 | pub mod most; 2 | 3 | pub struct Inner; 4 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff/most.rs: -------------------------------------------------------------------------------- 1 | pub struct Snarks; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod inner; 2 | 3 | pub struct Thing; 4 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/good.rs: -------------------------------------------------------------------------------- 1 | pub struct Thing; 2 | -------------------------------------------------------------------------------- /tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::mod_module_files)] 2 | 3 | mod good; 4 | pub use dep_with_mod::with_mod::Thing; 5 | 6 | fn main() { 7 | let _ = good::Thing; 8 | let _ = dep_with_mod::with_mod::Thing; 9 | } 10 | -------------------------------------------------------------------------------- /tests/workspace_test/path_dep/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "path_dep" 3 | version = "0.1.0" 4 | 5 | [features] 6 | primary_package_test = [] 7 | -------------------------------------------------------------------------------- /tests/workspace_test/path_dep/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::empty_loop)] 2 | 3 | #[cfg(feature = "primary_package_test")] 4 | pub fn lint_me() { 5 | loop {} 6 | } 7 | -------------------------------------------------------------------------------- /tests/workspace_test/src/main.rs: -------------------------------------------------------------------------------- 1 | #![deny(rust_2018_idioms)] 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tests/workspace_test/subcrate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "subcrate" 3 | version = "0.1.0" 4 | 5 | [dependencies] 6 | path_dep = { path = "../path_dep" } 7 | -------------------------------------------------------------------------------- /tests/workspace_test/subcrate/src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------