From 8fea1d94f3bbcc02c3822dd43da9a1133e90f715 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 6 Dec 2021 12:33:31 +0100 Subject: [PATCH] Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup --- .github/ISSUE_TEMPLATE/blank_issue.md | 18 - .github/ISSUE_TEMPLATE/blank_issue.yml | 44 + .github/ISSUE_TEMPLATE/bug_report.md | 43 - .github/ISSUE_TEMPLATE/bug_report.yml | 57 + .github/ISSUE_TEMPLATE/false_negative.md | 35 - .github/ISSUE_TEMPLATE/false_negative.yml | 50 + .github/ISSUE_TEMPLATE/false_positive.md | 44 - .github/ISSUE_TEMPLATE/false_positive.yml | 68 + .github/ISSUE_TEMPLATE/ice.md | 52 - .github/ISSUE_TEMPLATE/ice.yml | 48 + .github/ISSUE_TEMPLATE/new_lint.md | 36 - .github/ISSUE_TEMPLATE/new_lint.yml | 71 ++ .github/workflows/clippy_dev.yml | 12 - CHANGELOG.md | 20 +- Cargo.toml | 3 +- clippy_dev/Cargo.toml | 1 + clippy_dev/src/fmt.rs | 40 +- clippy_dev/src/lib.rs | 1 + clippy_dev/src/lint.rs | 20 + clippy_dev/src/main.rs | 15 +- clippy_dev/src/new_lint.rs | 21 +- clippy_dev/src/update_lints.rs | 5 + clippy_lints/Cargo.toml | 2 +- .../src/absurd_extreme_comparisons.rs | 1 + clippy_lints/src/approx_const.rs | 1 + clippy_lints/src/arithmetic.rs | 2 + clippy_lints/src/as_conversions.rs | 1 + clippy_lints/src/asm_syntax.rs | 2 + clippy_lints/src/assertions_on_constants.rs | 1 + clippy_lints/src/assign_ops.rs | 2 + clippy_lints/src/async_yields_async.rs | 1 + clippy_lints/src/attrs.rs | 26 +- clippy_lints/src/await_holding_invalid.rs | 2 + clippy_lints/src/bit_mask.rs | 3 + clippy_lints/src/blacklisted_name.rs | 1 + clippy_lints/src/blocks_in_if_conditions.rs | 1 + clippy_lints/src/bool_assert_comparison.rs | 3 +- clippy_lints/src/booleans.rs | 30 +- clippy_lints/src/bytecount.rs | 5 +- clippy_lints/src/cargo_common_metadata.rs | 1 + ...se_sensitive_file_extension_comparisons.rs | 1 + clippy_lints/src/casts/cast_lossless.rs | 41 +- clippy_lints/src/casts/mod.rs | 29 +- clippy_lints/src/checked_conversions.rs | 1 + clippy_lints/src/cognitive_complexity.rs | 1 + clippy_lints/src/collapsible_if.rs | 2 + clippy_lints/src/collapsible_match.rs | 1 + clippy_lints/src/comparison_chain.rs | 1 + clippy_lints/src/copies.rs | 10 +- clippy_lints/src/copy_iterator.rs | 1 + clippy_lints/src/create_dir.rs | 1 + clippy_lints/src/dbg_macro.rs | 9 + clippy_lints/src/default.rs | 8 +- clippy_lints/src/default_numeric_fallback.rs | 1 + clippy_lints/src/deprecated_lints.rs | 16 + clippy_lints/src/dereference.rs | 338 ++++- clippy_lints/src/derivable_impls.rs | 5 +- clippy_lints/src/derive.rs | 4 + ...llowed_method.rs => disallowed_methods.rs} | 13 +- clippy_lints/src/disallowed_script_idents.rs | 1 + ...disallowed_type.rs => disallowed_types.rs} | 15 +- clippy_lints/src/doc.rs | 30 +- clippy_lints/src/double_comparison.rs | 1 + clippy_lints/src/double_parens.rs | 1 + clippy_lints/src/drop_forget_ref.rs | 4 + clippy_lints/src/duration_subsec.rs | 1 + clippy_lints/src/else_if_without_else.rs | 1 + clippy_lints/src/empty_enum.rs | 1 + clippy_lints/src/entry.rs | 1 + clippy_lints/src/enum_clike.rs | 1 + clippy_lints/src/enum_variants.rs | 3 + clippy_lints/src/eq_op.rs | 8 +- clippy_lints/src/equatable_if_let.rs | 1 + clippy_lints/src/erasing_op.rs | 1 + clippy_lints/src/escape.rs | 1 + clippy_lints/src/eta_reduction.rs | 8 +- clippy_lints/src/eval_order_dependence.rs | 2 + clippy_lints/src/excessive_bools.rs | 5 +- clippy_lints/src/exhaustive_items.rs | 2 + clippy_lints/src/exit.rs | 1 + clippy_lints/src/explicit_write.rs | 1 + clippy_lints/src/fallible_impl_from.rs | 1 + clippy_lints/src/feature_name.rs | 2 + .../src/float_equality_without_abs.rs | 1 + clippy_lints/src/float_literal.rs | 2 + clippy_lints/src/floating_point_arithmetic.rs | 9 +- clippy_lints/src/format.rs | 1 + clippy_lints/src/format_args.rs | 13 +- clippy_lints/src/formatting.rs | 4 + clippy_lints/src/from_over_into.rs | 1 + clippy_lints/src/from_str_radix_10.rs | 1 + clippy_lints/src/functions/mod.rs | 7 + clippy_lints/src/functions/too_many_lines.rs | 4 +- clippy_lints/src/future_not_send.rs | 1 + clippy_lints/src/get_last_with_len.rs | 1 + clippy_lints/src/identity_op.rs | 1 + clippy_lints/src/if_let_mutex.rs | 1 + clippy_lints/src/if_not_else.rs | 1 + clippy_lints/src/if_then_some_else_none.rs | 14 +- clippy_lints/src/implicit_hasher.rs | 1 + clippy_lints/src/implicit_return.rs | 31 +- clippy_lints/src/implicit_saturating_sub.rs | 5 +- .../src/inconsistent_struct_constructor.rs | 4 +- clippy_lints/src/index_refutable_slice.rs | 276 ++++ clippy_lints/src/indexing_slicing.rs | 2 + clippy_lints/src/infinite_iter.rs | 2 + clippy_lints/src/inherent_impl.rs | 9 +- clippy_lints/src/inherent_to_string.rs | 2 + clippy_lints/src/inline_fn_without_body.rs | 1 + clippy_lints/src/int_plus_one.rs | 1 + clippy_lints/src/integer_division.rs | 1 + .../src/invalid_upcast_comparisons.rs | 1 + clippy_lints/src/items_after_statements.rs | 1 + .../src/iter_not_returning_iterator.rs | 1 + clippy_lints/src/large_const_arrays.rs | 1 + clippy_lints/src/large_enum_variant.rs | 1 + clippy_lints/src/large_stack_arrays.rs | 1 + clippy_lints/src/len_zero.rs | 3 + clippy_lints/src/let_if_seq.rs | 1 + clippy_lints/src/let_underscore.rs | 10 +- clippy_lints/src/lib.register_all.rs | 6 +- clippy_lints/src/lib.register_complexity.rs | 2 + clippy_lints/src/lib.register_internal.rs | 2 + clippy_lints/src/lib.register_lints.rs | 16 +- clippy_lints/src/lib.register_nursery.rs | 5 +- clippy_lints/src/lib.register_pedantic.rs | 3 +- clippy_lints/src/lib.register_style.rs | 3 +- clippy_lints/src/lib.register_suspicious.rs | 1 + clippy_lints/src/lib.rs | 136 +- clippy_lints/src/lifetimes.rs | 6 +- clippy_lints/src/literal_representation.rs | 13 +- .../src/loops/explicit_counter_loop.rs | 58 +- clippy_lints/src/loops/manual_memcpy.rs | 2 +- clippy_lints/src/loops/mod.rs | 18 + clippy_lints/src/loops/needless_collect.rs | 178 ++- clippy_lints/src/loops/utils.rs | 74 +- clippy_lints/src/macro_use.rs | 7 +- clippy_lints/src/main_recursion.rs | 1 + clippy_lints/src/manual_assert.rs | 1 + clippy_lints/src/manual_async_fn.rs | 1 + clippy_lints/src/manual_map.rs | 81 +- clippy_lints/src/manual_non_exhaustive.rs | 1 + clippy_lints/src/manual_ok_or.rs | 1 + clippy_lints/src/manual_strip.rs | 1 + clippy_lints/src/manual_unwrap_or.rs | 1 + clippy_lints/src/map_clone.rs | 1 + clippy_lints/src/map_err_ignore.rs | 1 + clippy_lints/src/map_unit_fn.rs | 4 +- clippy_lints/src/match_on_vec_items.rs | 1 + clippy_lints/src/match_result_ok.rs | 1 + clippy_lints/src/match_str_case_mismatch.rs | 1 + clippy_lints/src/matches.rs | 193 +-- clippy_lints/src/mem_forget.rs | 1 + clippy_lints/src/mem_replace.rs | 7 +- .../src/methods/bind_instead_of_map.rs | 4 +- .../methods/from_iter_instead_of_collect.rs | 2 +- .../src/methods/iter_cloned_collect.rs | 6 +- clippy_lints/src/methods/mod.rs | 107 +- .../src/methods/option_map_or_none.rs | 145 ++- clippy_lints/src/methods/or_fun_call.rs | 59 +- clippy_lints/src/methods/search_is_some.rs | 18 +- .../src/methods/single_char_pattern.rs | 7 +- .../{manual_split_once.rs => str_splitn.rs} | 150 ++- .../src/methods/unnecessary_lazy_eval.rs | 2 +- clippy_lints/src/methods/utils.rs | 8 +- clippy_lints/src/minmax.rs | 1 + clippy_lints/src/misc.rs | 9 + clippy_lints/src/misc_early/mod.rs | 10 + clippy_lints/src/missing_const_for_fn.rs | 1 + clippy_lints/src/missing_doc.rs | 1 + .../src/missing_enforced_import_rename.rs | 1 + clippy_lints/src/missing_inline.rs | 1 + clippy_lints/src/module_style.rs | 2 + clippy_lints/src/modulo_arithmetic.rs | 1 + clippy_lints/src/multiple_crate_versions.rs | 1 + clippy_lints/src/mut_key.rs | 1 + clippy_lints/src/mut_mut.rs | 1 + clippy_lints/src/mut_mutex_lock.rs | 1 + clippy_lints/src/mut_reference.rs | 1 + clippy_lints/src/mutable_debug_assertion.rs | 1 + clippy_lints/src/mutex_atomic.rs | 2 + .../src/needless_arbitrary_self_type.rs | 8 +- clippy_lints/src/needless_bitwise_bool.rs | 4 +- clippy_lints/src/needless_bool.rs | 2 + clippy_lints/src/needless_borrow.rs | 282 ----- clippy_lints/src/needless_borrowed_ref.rs | 1 + clippy_lints/src/needless_continue.rs | 1 + clippy_lints/src/needless_for_each.rs | 1 + clippy_lints/src/needless_late_init.rs | 349 +++++ clippy_lints/src/needless_option_as_deref.rs | 4 +- clippy_lints/src/needless_pass_by_value.rs | 1 + clippy_lints/src/needless_question_mark.rs | 34 +- clippy_lints/src/needless_update.rs | 1 + clippy_lints/src/neg_cmp_op_on_partial_ord.rs | 1 + clippy_lints/src/neg_multiply.rs | 1 + clippy_lints/src/new_without_default.rs | 1 + clippy_lints/src/no_effect.rs | 23 +- clippy_lints/src/non_copy_const.rs | 2 + clippy_lints/src/non_expressive_names.rs | 17 +- .../src/non_octal_unix_permissions.rs | 1 + .../src/non_send_fields_in_send_ty.rs | 29 +- clippy_lints/src/nonstandard_macro_braces.rs | 33 +- clippy_lints/src/octal_escapes.rs | 150 +++ clippy_lints/src/open_options.rs | 1 + clippy_lints/src/option_env_unwrap.rs | 1 + clippy_lints/src/option_if_let_else.rs | 17 +- .../src/overflow_check_conditional.rs | 1 + clippy_lints/src/panic_in_result_fn.rs | 1 + clippy_lints/src/panic_unimplemented.rs | 4 + clippy_lints/src/partialeq_ne_impl.rs | 1 + clippy_lints/src/pass_by_ref_or_value.rs | 2 + clippy_lints/src/path_buf_push_overwrite.rs | 1 + clippy_lints/src/pattern_type_mismatch.rs | 1 + clippy_lints/src/precedence.rs | 1 + clippy_lints/src/ptr.rs | 4 + clippy_lints/src/ptr_eq.rs | 4 +- clippy_lints/src/ptr_offset_with_cast.rs | 1 + clippy_lints/src/question_mark.rs | 1 + clippy_lints/src/ranges.rs | 5 + clippy_lints/src/redundant_clone.rs | 1 + clippy_lints/src/redundant_closure_call.rs | 1 + clippy_lints/src/redundant_else.rs | 1 + clippy_lints/src/redundant_field_names.rs | 1 + clippy_lints/src/redundant_pub_crate.rs | 1 + clippy_lints/src/redundant_slicing.rs | 5 +- .../src/redundant_static_lifetimes.rs | 1 + clippy_lints/src/ref_option_ref.rs | 1 + clippy_lints/src/reference.rs | 5 +- clippy_lints/src/regex.rs | 2 + clippy_lints/src/repeat_once.rs | 4 +- clippy_lints/src/returns.rs | 7 +- clippy_lints/src/same_name_method.rs | 7 +- clippy_lints/src/self_assignment.rs | 1 + clippy_lints/src/self_named_constructors.rs | 3 +- .../src/semicolon_if_nothing_returned.rs | 3 +- clippy_lints/src/serde_api.rs | 1 + clippy_lints/src/shadow.rs | 10 +- .../src/single_component_path_imports.rs | 4 +- clippy_lints/src/size_of_in_element_count.rs | 1 + .../src/slow_vector_initialization.rs | 1 + clippy_lints/src/stable_sort_primitive.rs | 1 + clippy_lints/src/strings.rs | 7 + clippy_lints/src/strlen_on_c_strings.rs | 67 +- .../src/suspicious_operation_groupings.rs | 1 + clippy_lints/src/suspicious_trait_impl.rs | 2 + clippy_lints/src/swap.rs | 50 +- clippy_lints/src/tabs_in_doc_comments.rs | 1 + clippy_lints/src/temporary_assignment.rs | 1 + clippy_lints/src/to_digit_is_some.rs | 1 + clippy_lints/src/to_string_in_display.rs | 1 + clippy_lints/src/trailing_empty_array.rs | 1 + clippy_lints/src/trait_bounds.rs | 12 +- clippy_lints/src/transmute/mod.rs | 13 + clippy_lints/src/transmuting_null.rs | 1 + clippy_lints/src/try_err.rs | 21 +- clippy_lints/src/types/mod.rs | 9 + .../src/undocumented_unsafe_blocks.rs | 13 +- clippy_lints/src/undropped_manually_drops.rs | 1 + clippy_lints/src/unicode.rs | 13 +- clippy_lints/src/uninit_vec.rs | 1 + clippy_lints/src/unit_hash.rs | 1 + clippy_lints/src/unit_return_expecting_ord.rs | 1 + clippy_lints/src/unit_types/mod.rs | 3 + clippy_lints/src/unnamed_address.rs | 2 + clippy_lints/src/unnecessary_self_imports.rs | 1 + clippy_lints/src/unnecessary_sort_by.rs | 1 + clippy_lints/src/unnecessary_wraps.rs | 5 +- clippy_lints/src/unnested_or_patterns.rs | 1 + clippy_lints/src/unsafe_removed_from_name.rs | 1 + clippy_lints/src/unused_async.rs | 1 + clippy_lints/src/unused_io_amount.rs | 1 + clippy_lints/src/unused_self.rs | 1 + clippy_lints/src/unused_unit.rs | 1 + clippy_lints/src/unwrap.rs | 6 +- clippy_lints/src/unwrap_in_result.rs | 1 + clippy_lints/src/upper_case_acronyms.rs | 1 + clippy_lints/src/use_self.rs | 11 +- clippy_lints/src/useless_conversion.rs | 1 + clippy_lints/src/utils/author.rs | 1123 ++++++++--------- clippy_lints/src/utils/conf.rs | 16 +- clippy_lints/src/utils/internal_lints.rs | 80 +- .../internal_lints/metadata_collector.rs | 29 +- clippy_lints/src/vec.rs | 1 + clippy_lints/src/vec_init_then_push.rs | 1 + clippy_lints/src/vec_resize_to_zero.rs | 1 + clippy_lints/src/verbose_file_reads.rs | 1 + clippy_lints/src/wildcard_dependencies.rs | 1 + clippy_lints/src/wildcard_imports.rs | 6 +- clippy_lints/src/write.rs | 29 +- clippy_lints/src/zero_div_zero.rs | 1 + clippy_lints/src/zero_sized_map_values.rs | 1 + clippy_utils/Cargo.toml | 2 +- clippy_utils/src/ast_utils.rs | 115 +- clippy_utils/src/attrs.rs | 15 +- clippy_utils/src/eager_or_lazy.rs | 313 +++-- clippy_utils/src/lib.rs | 120 +- clippy_utils/src/msrvs.rs | 5 +- clippy_utils/src/paths.rs | 5 +- clippy_utils/src/ptr.rs | 58 +- clippy_utils/src/source.rs | 16 +- clippy_utils/src/sugg.rs | 277 +++- clippy_utils/src/ty.rs | 39 +- clippy_utils/src/usage.rs | 107 +- clippy_utils/src/visitors.rs | 311 +++-- doc/adding_lints.md | 15 +- doc/changelog_update.md | 2 +- doc/common_tools_writing_lints.md | 155 ++- lintcheck/src/main.rs | 4 +- rust-toolchain | 4 +- src/driver.rs | 2 +- tests/compile-test.rs | 3 + tests/fmt.rs | 5 +- .../check_clippy_version_attribute.rs | 87 ++ .../check_clippy_version_attribute.stderr | 73 ++ .../collapsible_span_lint_calls.fixed | 1 + .../collapsible_span_lint_calls.rs | 1 + .../collapsible_span_lint_calls.stderr | 10 +- tests/ui-internal/custom_ice_message.rs | 1 + tests/ui-internal/default_lint.rs | 1 + tests/ui-internal/default_lint.stderr | 2 +- tests/ui-internal/if_chain_style.rs | 2 +- .../interning_defined_symbol.fixed | 1 + tests/ui-internal/interning_defined_symbol.rs | 1 + .../interning_defined_symbol.stderr | 8 +- tests/ui-internal/invalid_paths.rs | 1 + tests/ui-internal/invalid_paths.stderr | 4 +- tests/ui-internal/lint_without_lint_pass.rs | 1 + .../ui-internal/lint_without_lint_pass.stderr | 2 +- tests/ui-internal/match_type_on_diag_item.rs | 1 + .../match_type_on_diag_item.stderr | 6 +- tests/ui-internal/outer_expn_data.fixed | 1 + tests/ui-internal/outer_expn_data.rs | 1 + tests/ui-internal/outer_expn_data.stderr | 2 +- .../ui-internal/unnecessary_symbol_str.fixed | 6 +- tests/ui-internal/unnecessary_symbol_str.rs | 6 +- .../ui-internal/unnecessary_symbol_str.stderr | 10 +- .../clippy.toml | 1 + .../index_refutable_slice.rs | 23 + .../index_refutable_slice.stderr | 22 + .../min_rust_version/min_rust_version.rs | 10 + .../clippy.toml | 0 .../conf_disallowed_methods.rs} | 2 +- .../conf_disallowed_methods.stderr} | 8 +- .../clippy.toml | 0 .../conf_disallowed_types.rs} | 2 +- .../conf_disallowed_types.stderr} | 44 +- .../toml_unknown_key/conf_unknown_key.stderr | 2 +- tests/ui/author.stdout | 12 +- tests/ui/author/blocks.rs | 9 + tests/ui/author/blocks.stdout | 68 +- tests/ui/author/call.stdout | 14 +- tests/ui/author/for_loop.rs | 8 - tests/ui/author/for_loop.stdout | 49 - tests/ui/author/if.rs | 7 + tests/ui/author/if.stdout | 54 +- tests/ui/author/issue_3849.stdout | 14 +- tests/ui/author/loop.rs | 36 + tests/ui/author/loop.stdout | 113 ++ tests/ui/author/matches.stdout | 49 +- tests/ui/author/repeat.rs | 5 + tests/ui/author/repeat.stdout | 11 + tests/ui/author/struct.rs | 40 + tests/ui/author/struct.stdout | 64 + tests/ui/cast_lossless_bool.fixed | 42 + tests/ui/cast_lossless_bool.rs | 42 + tests/ui/cast_lossless_bool.stderr | 82 ++ tests/ui/crashes/auxiliary/ice-7934-aux.rs | 4 + tests/ui/crashes/ice-7934.rs | 7 + tests/ui/crate_level_checks/no_std_swap.rs | 14 + .../ui/crate_level_checks/no_std_swap.stderr | 12 + tests/ui/doc/doc-fixable.stderr | 209 ++- tests/ui/doc/unbalanced_ticks.stderr | 21 +- tests/ui/explicit_counter_loop.rs | 30 + tests/ui/explicit_counter_loop.stderr | 16 +- tests/ui/floating_point_abs.fixed | 6 + tests/ui/floating_point_abs.rs | 6 + tests/ui/floating_point_abs.stderr | 16 +- tests/ui/floating_point_mul_add.fixed | 11 + tests/ui/floating_point_mul_add.rs | 11 + tests/ui/floating_point_mul_add.stderr | 20 +- tests/ui/floating_point_rad.fixed | 7 + tests/ui/floating_point_rad.rs | 7 + tests/ui/floating_point_rad.stderr | 4 +- tests/ui/if_then_some_else_none.rs | 11 + .../if_let_slice_binding.rs | 166 +++ .../if_let_slice_binding.stderr | 158 +++ .../slice_indexing_in_macro.rs | 28 + .../slice_indexing_in_macro.stderr | 22 + tests/ui/iter_cloned_collect.fixed | 3 + tests/ui/iter_cloned_collect.rs | 3 + tests/ui/iter_cloned_collect.stderr | 8 +- tests/ui/let_if_seq.rs | 3 +- tests/ui/let_if_seq.stderr | 8 +- tests/ui/let_underscore_lock.rs | 14 + tests/ui/let_underscore_lock.stderr | 46 +- tests/ui/manual_assert.edition2018.fixed | 2 + tests/ui/manual_assert.edition2018.stderr | 14 +- tests/ui/manual_assert.edition2021.fixed | 2 + tests/ui/manual_assert.edition2021.stderr | 14 +- tests/ui/manual_assert.fixed | 2 + tests/ui/manual_assert.rs | 2 + tests/ui/manual_map_option_2.fixed | 10 + tests/ui/manual_map_option_2.rs | 19 + tests/ui/manual_map_option_2.stderr | 32 +- tests/ui/manual_split_once.fixed | 6 +- tests/ui/manual_split_once.rs | 2 +- tests/ui/manual_split_once.stderr | 10 +- tests/ui/match_overlapping_arm.rs | 18 + tests/ui/match_overlapping_arm.stderr | 26 +- tests/ui/min_max.rs | 7 +- tests/ui/min_max.stderr | 26 +- tests/ui/min_rust_version_attr.rs | 35 +- tests/ui/min_rust_version_attr.stderr | 8 +- tests/ui/needless_borrow.fixed | 23 +- tests/ui/needless_borrow.rs | 23 +- tests/ui/needless_borrow.stderr | 50 +- tests/ui/needless_collect_indirect.rs | 31 + tests/ui/needless_late_init.rs | 167 +++ tests/ui/needless_late_init.stderr | 150 +++ tests/ui/needless_late_init_fixable.fixed | 38 + tests/ui/needless_late_init_fixable.rs | 38 + tests/ui/needless_late_init_fixable.stderr | 103 ++ tests/ui/needless_question_mark.stderr | 24 +- tests/ui/needless_return.fixed | 1 + tests/ui/needless_return.rs | 1 + tests/ui/needless_return.stderr | 36 +- tests/ui/needless_splitn.fixed | 27 + tests/ui/needless_splitn.rs | 27 + tests/ui/needless_splitn.stderr | 40 + tests/ui/no_effect.rs | 35 +- tests/ui/no_effect.stderr | 60 +- tests/ui/non_send_fields_in_send_ty.rs | 5 + tests/ui/non_send_fields_in_send_ty.stderr | 20 +- tests/ui/octal_escapes.rs | 20 + tests/ui/octal_escapes.stderr | 131 ++ tests/ui/option_env_unwrap.rs | 1 + tests/ui/option_env_unwrap.stderr | 12 +- tests/ui/option_filter_map.fixed | 10 +- tests/ui/option_filter_map.rs | 10 +- tests/ui/option_filter_map.stderr | 16 +- tests/ui/option_if_let_else.fixed | 15 +- tests/ui/option_if_let_else.rs | 17 + tests/ui/option_if_let_else.stderr | 24 +- tests/ui/option_map_or_none.fixed | 18 +- tests/ui/option_map_or_none.rs | 16 +- tests/ui/option_map_or_none.stderr | 53 +- tests/ui/or_fun_call.fixed | 30 +- tests/ui/or_fun_call.rs | 18 +- tests/ui/or_fun_call.stderr | 70 +- tests/ui/pattern_type_mismatch/mutability.rs | 9 + tests/ui/redundant_closure_call_late.rs | 1 + tests/ui/redundant_closure_call_late.stderr | 6 +- tests/ui/redundant_else.rs | 2 +- .../redundant_pattern_matching_option.fixed | 6 + tests/ui/redundant_pattern_matching_option.rs | 6 + .../redundant_pattern_matching_option.stderr | 14 +- .../redundant_pattern_matching_result.fixed | 4 +- .../redundant_pattern_matching_result.stderr | 4 +- tests/ui/rename.fixed | 5 + tests/ui/rename.rs | 5 + tests/ui/rename.stderr | 74 +- tests/ui/same_name_method.stderr | 10 +- tests/ui/search_is_some.rs | 6 + tests/ui/search_is_some.stderr | 20 +- tests/ui/search_is_some_fixable.fixed | 68 - tests/ui/search_is_some_fixable.rs | 68 - tests/ui/search_is_some_fixable.stderr | 184 --- tests/ui/search_is_some_fixable_none.fixed | 216 ++++ tests/ui/search_is_some_fixable_none.rs | 222 ++++ tests/ui/search_is_some_fixable_none.stderr | 293 +++++ tests/ui/search_is_some_fixable_some.fixed | 218 ++++ tests/ui/search_is_some_fixable_some.rs | 221 ++++ tests/ui/search_is_some_fixable_some.stderr | 276 ++++ tests/ui/semicolon_if_nothing_returned.rs | 10 + tests/ui/semicolon_if_nothing_returned.stderr | 10 +- tests/ui/shadow.rs | 6 + tests/ui/shadow.stderr | 14 +- tests/ui/single_char_pattern.fixed | 10 +- tests/ui/single_char_pattern.rs | 10 +- tests/ui/single_char_pattern.stderr | 102 +- tests/ui/strlen_on_c_strings.fixed | 34 + tests/ui/strlen_on_c_strings.rs | 22 +- tests/ui/strlen_on_c_strings.stderr | 53 +- tests/ui/suspicious_splitn.rs | 1 + tests/ui/suspicious_splitn.stderr | 18 +- tests/ui/undocumented_unsafe_blocks.rs | 4 + tests/ui/undocumented_unsafe_blocks.stderr | 14 +- tests/ui/unicode.rs | 8 + tests/ui/unicode.stderr | 14 +- triagebot.toml | 5 + util/gh-pages/index.html | 16 +- 491 files changed, 9888 insertions(+), 3255 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/blank_issue.md create mode 100644 .github/ISSUE_TEMPLATE/blank_issue.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/false_negative.md create mode 100644 .github/ISSUE_TEMPLATE/false_negative.yml delete mode 100644 .github/ISSUE_TEMPLATE/false_positive.md create mode 100644 .github/ISSUE_TEMPLATE/false_positive.yml delete mode 100644 .github/ISSUE_TEMPLATE/ice.md create mode 100644 .github/ISSUE_TEMPLATE/ice.yml delete mode 100644 .github/ISSUE_TEMPLATE/new_lint.md create mode 100644 .github/ISSUE_TEMPLATE/new_lint.yml create mode 100644 clippy_dev/src/lint.rs rename clippy_lints/src/{disallowed_method.rs => disallowed_methods.rs} (91%) rename clippy_lints/src/{disallowed_type.rs => disallowed_types.rs} (93%) create mode 100644 clippy_lints/src/index_refutable_slice.rs rename clippy_lints/src/methods/{manual_split_once.rs => str_splitn.rs} (60%) delete mode 100644 clippy_lints/src/needless_borrow.rs create mode 100644 clippy_lints/src/needless_late_init.rs create mode 100644 clippy_lints/src/octal_escapes.rs create mode 100644 tests/ui-internal/check_clippy_version_attribute.rs create mode 100644 tests/ui-internal/check_clippy_version_attribute.stderr create mode 100644 tests/ui-toml/max_suggested_slice_pattern_length/clippy.toml create mode 100644 tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs create mode 100644 tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr rename tests/ui-toml/{toml_disallowed_method => toml_disallowed_methods}/clippy.toml (100%) rename tests/ui-toml/{toml_disallowed_method/conf_disallowed_method.rs => toml_disallowed_methods/conf_disallowed_methods.rs} (82%) rename tests/ui-toml/{toml_disallowed_method/conf_disallowed_method.stderr => toml_disallowed_methods/conf_disallowed_methods.stderr} (71%) rename tests/ui-toml/{toml_disallowed_type => toml_disallowed_types}/clippy.toml (100%) rename tests/ui-toml/{toml_disallowed_type/conf_disallowed_type.rs => toml_disallowed_types/conf_disallowed_types.rs} (96%) rename tests/ui-toml/{toml_disallowed_type/conf_disallowed_type.stderr => toml_disallowed_types/conf_disallowed_types.stderr} (79%) delete mode 100644 tests/ui/author/for_loop.rs delete mode 100644 tests/ui/author/for_loop.stdout create mode 100644 tests/ui/author/loop.rs create mode 100644 tests/ui/author/loop.stdout create mode 100644 tests/ui/author/repeat.rs create mode 100644 tests/ui/author/repeat.stdout create mode 100644 tests/ui/author/struct.rs create mode 100644 tests/ui/author/struct.stdout create mode 100644 tests/ui/cast_lossless_bool.fixed create mode 100644 tests/ui/cast_lossless_bool.rs create mode 100644 tests/ui/cast_lossless_bool.stderr create mode 100644 tests/ui/crashes/auxiliary/ice-7934-aux.rs create mode 100644 tests/ui/crashes/ice-7934.rs create mode 100644 tests/ui/crate_level_checks/no_std_swap.rs create mode 100644 tests/ui/crate_level_checks/no_std_swap.stderr create mode 100644 tests/ui/index_refutable_slice/if_let_slice_binding.rs create mode 100644 tests/ui/index_refutable_slice/if_let_slice_binding.stderr create mode 100644 tests/ui/index_refutable_slice/slice_indexing_in_macro.rs create mode 100644 tests/ui/index_refutable_slice/slice_indexing_in_macro.stderr create mode 100644 tests/ui/needless_late_init.rs create mode 100644 tests/ui/needless_late_init.stderr create mode 100644 tests/ui/needless_late_init_fixable.fixed create mode 100644 tests/ui/needless_late_init_fixable.rs create mode 100644 tests/ui/needless_late_init_fixable.stderr create mode 100644 tests/ui/needless_splitn.fixed create mode 100644 tests/ui/needless_splitn.rs create mode 100644 tests/ui/needless_splitn.stderr create mode 100644 tests/ui/octal_escapes.rs create mode 100644 tests/ui/octal_escapes.stderr delete mode 100644 tests/ui/search_is_some_fixable.fixed delete mode 100644 tests/ui/search_is_some_fixable.rs delete mode 100644 tests/ui/search_is_some_fixable.stderr create mode 100644 tests/ui/search_is_some_fixable_none.fixed create mode 100644 tests/ui/search_is_some_fixable_none.rs create mode 100644 tests/ui/search_is_some_fixable_none.stderr create mode 100644 tests/ui/search_is_some_fixable_some.fixed create mode 100644 tests/ui/search_is_some_fixable_some.rs create mode 100644 tests/ui/search_is_some_fixable_some.stderr create mode 100644 tests/ui/strlen_on_c_strings.fixed diff --git a/.github/ISSUE_TEMPLATE/blank_issue.md b/.github/ISSUE_TEMPLATE/blank_issue.md deleted file mode 100644 index 866303a1f9f..00000000000 --- a/.github/ISSUE_TEMPLATE/blank_issue.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Blank Issue -about: Create a blank issue. ---- - - - diff --git a/.github/ISSUE_TEMPLATE/blank_issue.yml b/.github/ISSUE_TEMPLATE/blank_issue.yml new file mode 100644 index 00000000000..d610e8c7bc4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/blank_issue.yml @@ -0,0 +1,44 @@ +name: Blank Issue +description: Create a blank issue. +body: + - type: markdown + attributes: + value: Thank you for filing an issue! + - type: textarea + id: problem + attributes: + label: Description + description: > + Please provide a discription of the issue, along with any information + you feel relevant to replicate it. + validations: + required: true + - type: textarea + id: version + attributes: + label: Version + description: "Rust version (`rustc -Vv`)" + placeholder: | + rustc 1.46.0-nightly (f455e46ea 2020-06-20) + binary: rustc + commit-hash: f455e46eae1a227d735091091144601b467e1565 + commit-date: 2020-06-20 + host: x86_64-unknown-linux-gnu + release: 1.46.0-nightly + LLVM version: 10.0 + render: text + - type: textarea + id: labels + attributes: + label: Additional Labels + description: > + Additional labels can be added to this issue by including the following + command + placeholder: | + @rustbot label +