rust-clippy/clippy_lints/src
bors 55efa96659 Auto merge of #5931 - montrivo:unit-arg, r=flip1995
improve the suggestion of the lint `unit-arg`

Fixes #5823
Fixes #6015

Changes
```
help: move the expression in front of the call...
  |
3 |     g();
  |
help: ...and use a unit literal instead
  |
3 |     o.map_or((), |i| f(i))
  |
```
into
```
help: move the expression in front of the call and replace it with the unit literal `()`
  |
3 |     g();
  |     o.map_or((), |i| f(i))
  |
```
changelog: improve the suggestion of the lint `unit-arg`
2020-09-10 14:11:27 +00:00
..
methods Merge remote-tracking branch 'upstream/master' into sync-from-rust 2020-09-04 23:27:01 +02:00
utils Auto merge of #5931 - montrivo:unit-arg, r=flip1995 2020-09-10 14:11:27 +00:00
approx_const.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
arithmetic.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
as_conversions.rs Add an Option<Span> argument to span_lint_and_help. 2020-04-18 18:28:29 +08:00
assertions_on_constants.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
assign_ops.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
async_yields_async.rs Formatting changes requested by ThibsG. 2020-08-29 15:33:54 -07:00
atomic_ordering.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
attrs.rs useless_attribute: Permit wildcard_imports and enum_glob_use 2020-09-01 12:09:32 +09:00
await_holding_lock.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
bit_mask.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
blacklisted_name.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
blocks_in_if_conditions.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
booleans.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
bytecount.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
cargo_common_metadata.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
checked_conversions.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
cognitive_complexity.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
collapsible_if.rs Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup 2020-07-14 14:59:59 +02:00
comparison_chain.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
consts.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
copies.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
copy_iterator.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
dbg_macro.rs Add an Option<Span> argument to span_lint_and_help. 2020-04-18 18:28:29 +08:00
default_trait_access.rs Fix fallout from rustup 2020-09-04 23:30:06 +02:00
deprecated_lints.rs Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup 2020-07-26 21:07:07 +02:00
dereference.rs Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup 2020-07-26 21:07:07 +02:00
derive.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
doc.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
double_comparison.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
double_parens.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
drop_bounds.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
drop_forget_ref.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
duration_subsec.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
else_if_without_else.rs Add an Option<Span> argument to span_lint_and_help. 2020-04-18 18:28:29 +08:00
empty_enum.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
entry.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
enum_clike.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
enum_variants.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
eq_op.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
erasing_op.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
escape.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
eta_reduction.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
eval_order_dependence.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
excessive_bools.rs Add an Option<Span> argument to span_lint_and_help. 2020-04-18 18:28:29 +08:00
exit.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
explicit_write.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
fallible_impl_from.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
float_equality_without_abs.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
float_literal.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
floating_point_arithmetic.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
format.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
formatting.rs Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup 2020-07-14 14:59:59 +02:00
functions.rs add line_count and max_lines to too_many_lines lint message 2020-09-04 19:26:35 -06:00
future_not_send.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
get_last_with_len.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
identity_op.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
if_let_mutex.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
if_let_some_result.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
if_not_else.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
implicit_return.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
implicit_saturating_sub.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
indexing_slicing.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
infinite_iter.rs clippy: support QPath::LangItem 2020-08-17 13:55:05 +01:00
inherent_impl.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
inherent_to_string.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
inline_fn_without_body.rs rustc_ast: (Nested)MetaItem::check_name -> has_name 2020-08-04 00:34:11 +03:00
int_plus_one.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
integer_division.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
items_after_statements.rs Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy 2020-06-09 14:36:01 +00:00
large_const_arrays.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
large_enum_variant.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
large_stack_arrays.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
len_zero.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
let_if_seq.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
let_underscore.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
lib.rs Add a lint for an async block/closure that yields a type that is itself awaitable. 2020-08-29 15:33:54 -07:00
lifetimes.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
literal_representation.rs Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup 2020-07-14 14:59:59 +02:00
loops.rs Address items_after_statement 2020-09-08 23:12:04 +09:00
macro_use.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
main_recursion.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
manual_async_fn.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
manual_non_exhaustive.rs Eliminate the SessionGlobals from librustc_ast. 2020-08-08 12:03:42 +10:00
map_clone.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
map_identity.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
map_unit_fn.rs print the unit type () in related lint messages. 2020-09-09 17:59:13 +02:00
match_on_vec_items.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
matches.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
mem_discriminant.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
mem_forget.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
mem_replace.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
minmax.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
misc.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
misc_early.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
missing_const_for_fn.rs Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup 2020-07-26 21:07:07 +02:00
missing_doc.rs rustc_ast: (Nested)MetaItem::check_name -> has_name 2020-08-04 00:34:11 +03:00
missing_inline.rs rustc_ast: (Nested)MetaItem::check_name -> has_name 2020-08-04 00:34:11 +03:00
modulo_arithmetic.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
multiple_crate_versions.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
mut_key.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
mut_mut.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
mut_reference.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
mutable_debug_assertion.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
mutex_atomic.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
needless_arbitrary_self_type.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
needless_bool.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
needless_borrow.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
needless_borrowed_ref.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
needless_continue.rs Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy 2020-06-09 14:36:01 +00:00
needless_pass_by_value.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
needless_update.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
neg_cmp_op_on_partial_ord.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
neg_multiply.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
new_without_default.rs merge as_local_hir_id with local_def_id_to_hir_id 2020-08-13 16:55:16 +02:00
no_effect.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
non_copy_const.rs ty.flags -> ty.flags() 2020-09-04 18:28:20 +02:00
non_expressive_names.rs Eliminate the SessionGlobals from librustc_ast. 2020-08-08 12:03:42 +10:00
open_options.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
option_env_unwrap.rs Update Clippy for MethodCall changes 2020-06-10 17:30:11 -04:00
option_if_let_else.rs Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup 2020-07-26 21:07:07 +02:00
overflow_check_conditional.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
panic_unimplemented.rs Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup 2020-07-26 21:07:07 +02:00
partialeq_ne_impl.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
path_buf_push_overwrite.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
pattern_type_mismatch.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
precedence.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
ptr.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
ptr_offset_with_cast.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
question_mark.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
ranges.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
redundant_clone.rs Auto merge of #76044 - ecstatic-morse:dataflow-lattice, r=oli-obk 2020-09-07 21:29:43 +00:00
redundant_closure_call.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
redundant_field_names.rs Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2 2020-05-28 15:45:24 +02:00
redundant_pub_crate.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
redundant_static_lifetimes.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
reference.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
regex.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
repeat_once.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
returns.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
self_assignment.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
serde_api.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
shadow.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
single_component_path_imports.rs rust_ast::ast => rustc_ast 2020-08-17 20:32:32 +00:00
slow_vector_initialization.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
stable_sort_primitive.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
strings.rs rust_ast::ast => rustc_ast 2020-08-17 20:32:32 +00:00
suspicious_trait_impl.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
swap.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
tabs_in_doc_comments.rs Add some comments for magic numbers + Add tests 2020-08-06 22:55:26 +03:00
temporary_assignment.rs Cleanup of rustup 2020-09-10 15:23:38 +02:00
to_digit_is_some.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
to_string_in_display.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
trait_bounds.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
transmute.rs Merge remote-tracking branch 'upstream/master' into sync-from-rust 2020-09-04 23:27:01 +02:00
transmuting_null.rs rust_ast::ast => rustc_ast 2020-08-17 20:32:32 +00:00
trivially_copy_pass_by_ref.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
try_err.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
types.rs Auto merge of #5931 - montrivo:unit-arg, r=flip1995 2020-09-10 14:11:27 +00:00
unicode.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
unit_return_expecting_ord.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
unnamed_address.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
unnecessary_sort_by.rs Restrict unnecessary_sort_by to non-ref copy types 2020-09-07 00:19:17 +02:00
unnested_or_patterns.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
unsafe_removed_from_name.rs Avoid storing SymbolStr in a struct. 2020-07-17 08:28:22 +10:00
unused_io_amount.rs clippy: support QPath::LangItem 2020-08-17 13:55:05 +01:00
unused_self.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
unused_unit.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
unwrap.rs Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup 2020-08-11 17:50:45 +02:00
unwrap_in_result.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
use_self.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
useless_conversion.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
vec.rs ty.kind -> ty.kind() in rustdoc and clippy 2020-09-04 18:27:33 +02:00
vec_resize_to_zero.rs rust_ast::ast => rustc_ast 2020-08-17 20:32:32 +00:00
verbose_file_reads.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00
wildcard_dependencies.rs Use 'tcx for references to AccessLevels wherever possible. 2020-07-03 00:04:48 +03:00
wildcard_imports.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
write.rs Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup 2020-08-28 18:43:25 +02:00
zero_div_zero.rs Rename TypeckTables to TypeckResults. 2020-07-17 08:47:04 +00:00