rust-clippy/clippy_lints/src
bors 8af4e09605 Auto merge of #4458 - flip1995:block_in_if_ext_macro, r=phansch
Allow block_in_if_{stmt,expr} in external macro

I found this by running `cargo fix --clippy` on quite a big codebase.

You could refactor this assert to
```rust
let block_expr = _;
assert!(block_expr);
```

but,
1. it doesn't increase the readability IMO
2. That isn't possible in a `debug_assert!`

I'm not sure though, if we should allow this for macros in general or just for external macros.

changelog: Allow `block_in_if_{stmt,expr}` in external macros
2019-09-09 14:55:33 +00:00
..
methods Use diagnostic item for 2019-09-09 05:43:39 +02:00
utils Use diagnostic item for 2019-09-09 05:43:39 +02:00
approx_const.rs Dogfood 2019-05-18 01:42:15 +02:00
arithmetic.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
assertions_on_constants.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
assign_ops.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
attrs.rs Rustup "Minimize uses of LocalInternedString" 2019-09-05 07:16:57 +00:00
bit_mask.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
blacklisted_name.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
block_in_if_condition.rs Allow block_in_if_{stmt,expr} in external macro 2019-08-27 09:43:03 +02:00
booleans.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
bytecount.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
cargo_common_metadata.rs Refactor option handling 2019-09-04 16:19:59 +02:00
checked_conversions.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
cognitive_complexity.rs Remove use of the HIR CFG 2019-09-08 16:27:54 +01:00
collapsible_if.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
consts.rs Remove Allocation::bytes 2019-09-03 18:29:08 +09:00
copies.rs Rustup "Minimize uses of LocalInternedString" 2019-09-05 07:16:57 +00:00
copy_iterator.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
dbg_macro.rs Refactor option handling 2019-09-04 16:19:59 +02:00
default_trait_access.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
deprecated_lints.rs Deprecate unused_collect lint 2019-08-14 21:47:11 +02:00
derive.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
doc.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
double_comparison.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
double_parens.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
drop_bounds.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
drop_forget_ref.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
duration_subsec.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
else_if_without_else.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
empty_enum.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
entry.rs Fix map_entry false positive 2019-09-03 20:31:02 +09:00
enum_clike.rs Rustup to rust-lang/rust#63543 2019-08-15 10:14:06 +02:00
enum_glob_use.rs rustup https://github.com/rust-lang/rust/pull/61836/ 2019-06-18 11:15:47 +02:00
enum_variants.rs Rustup "Minimize uses of LocalInternedString" 2019-09-05 07:16:57 +00:00
eq_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
erasing_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
escape.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
eta_reduction.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
eval_order_dependence.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
excessive_precision.rs Refactor option handling 2019-09-04 16:19:59 +02:00
explicit_write.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
fallible_impl_from.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
format.rs Re-add false positive check 2019-08-23 09:16:50 +00:00
formatting.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
functions.rs Refactor option handling 2019-09-04 16:19:59 +02:00
get_last_with_len.rs Formatting inside if_chain! macro 2019-05-21 10:45:38 +02:00
identity_conversion.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
identity_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
if_not_else.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
implicit_return.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
indexing_slicing.rs Rustup https://github.com/rust-lang/rust/pull/59369 2019-08-06 19:20:41 +07:00
infallible_destructuring_match.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
infinite_iter.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
inherent_impl.rs Fix breakage due to rust-lang/rust#61968 2019-06-21 08:14:07 +02:00
inherent_to_string.rs Fix inherent_to_string false positive 2019-08-28 06:46:26 +09:00
inline_fn_without_body.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
int_plus_one.rs Update int_plus_one suggestion text 2019-08-28 07:29:30 +02:00
integer_division.rs Downgrade integer_division to restriction 2019-06-15 00:17:04 -07:00
items_after_statements.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
large_enum_variant.rs Rustup to rust-lang/rust#63543 2019-08-15 10:14:06 +02:00
len_zero.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
let_if_seq.rs Fix warnings about unnecessary lifetime bounds 2019-06-20 01:36:23 +07:00
lib.rs Fix regression in case of proc-macro attribute expansion 2019-09-09 16:14:32 +07:00
lifetimes.rs Fix needless_lifetimes false positive 2019-09-01 08:11:40 +02:00
literal_representation.rs Update all the code to pass the updated use_self lint. 2019-07-31 08:50:43 +00:00
loops.rs Use diagnostic item for 2019-09-09 05:43:39 +02:00
main_recursion.rs Move expression check to LateLintPass 2019-08-05 13:23:30 +02:00
map_clone.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
map_unit_fn.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
matches.rs Fix match_as_ref bad suggestion 2019-08-25 07:10:45 +02:00
mem_discriminant.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
mem_forget.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
mem_replace.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
minmax.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
misc.rs Fix redundant_pattern false positive 2019-09-05 00:36:48 +09:00
misc_early.rs Fix regression in case of proc-macro attribute expansion 2019-09-09 16:14:32 +07:00
missing_const_for_fn.rs Fix missing_const_for_fn false positive 2019-08-29 08:07:41 +02:00
missing_doc.rs Rustup to https://github.com/rust-lang/rust/pull/63854 2019-08-25 08:06:32 +02:00
missing_inline.rs Rollup merge of #4331 - phansch:doctests_restriction, r=flip1995 2019-08-05 10:50:06 +02:00
multiple_crate_versions.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
mut_mut.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
mut_reference.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
mutex_atomic.rs Doctests: Enable running doc tests for nursery lints 2019-08-03 21:01:23 +02:00
needless_bool.rs Add examples to some complexity lints 2019-08-22 15:41:07 +02:00
needless_borrow.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_borrowed_ref.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_continue.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_pass_by_value.rs Use diagnostic item for 2019-09-09 05:43:39 +02:00
needless_update.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
neg_cmp_op_on_partial_ord.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
neg_multiply.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
new_without_default.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
no_effect.rs Refactor option handling 2019-09-04 16:19:59 +02:00
non_copy_const.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
non_expressive_names.rs Update non_expressive_names for or patterns 2019-09-08 16:27:54 +01:00
ok_if_let.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
open_options.rs Update formatting 2019-08-01 07:09:57 +02:00
overflow_check_conditional.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
panic_unimplemented.rs Use outer_expn_data instead of outer_expn_info 2019-08-16 09:31:12 -07:00
partialeq_ne_impl.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
path_buf_push_overwrite.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
precedence.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
ptr.rs Use diagnostic item for 2019-09-09 05:43:39 +02:00
ptr_offset_with_cast.rs Update all the code to pass the updated use_self lint. 2019-07-31 08:50:43 +00:00
question_mark.rs rustup https://github.com/rust-lang/rust/pull/61995 2019-07-03 18:00:35 +02:00
ranges.rs Fix occurrences of too_many_lines violations 2019-09-03 06:26:49 +02:00
redundant_clone.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
redundant_field_names.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
redundant_pattern_matching.rs Fix suggestions for redundant_pattern_matching 2019-08-21 07:29:44 +02:00
redundant_static_lifetimes.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
reference.rs Allow deref_addrof in macros 2019-09-03 00:17:23 +09:00
regex.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
replace_consts.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
returns.rs Fix unused_unit false positive 2019-08-24 22:09:02 +02:00
serde_api.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
shadow.rs Rustup "Remove Spanned from {ast,hir}::FieldPat" 2019-08-16 09:32:27 +07:00
slow_vector_initialization.rs Doctests: Enable running doc tests for perf lints 2019-08-03 08:08:00 +02:00
strings.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
suspicious_trait_impl.rs get_parent_node_by_hir_id -> get_parent_node 2019-06-25 14:33:51 -07:00
swap.rs Use diagnostic item for 2019-09-09 05:43:39 +02:00
temporary_assignment.rs Rustup to rustc 1.36.0-nightly (13fde05b1 2019-05-03) 2019-05-03 22:28:34 -07:00
trait_bounds.rs Made lint pedantic 2019-08-17 11:45:05 +01:00
transmute.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
transmuting_null.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
trivially_copy_pass_by_ref.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
try_err.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
types.rs Use diagnostic item for 2019-09-09 05:43:39 +02:00
unicode.rs Update Unicode lint tests 2019-08-23 05:42:45 +00:00
unsafe_removed_from_name.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
unused_io_amount.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
unused_label.rs Rustup "Minimize uses of LocalInternedString" 2019-09-05 07:16:57 +00:00
unwrap.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
use_self.rs Update formatting 2019-08-01 07:09:57 +02:00
vec.rs Use outer_expn_data instead of outer_expn_info 2019-08-16 09:31:12 -07:00
wildcard_dependencies.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
write.rs Fix occurrences of too_many_lines violations 2019-09-03 06:26:49 +02:00
zero_div_zero.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00