rust-clippy/clippy_lints/src
bors 14d2aa1582 Auto merge of #7542 - LeSeulArtichaut:cleanups, r=flip1995
Cleanup usage of `span_to_snippet` and `LintContext::sess`

- avoid using `SourceMap::span_to_snippet` directly and use `clippy_utils::source::snippet_opt` instead
- don't use `LintContext::sess()` on `EarlyContext`s which have a `sess` field directly available, saving the import of `LintContext`

changelog: none
2021-08-09 13:48:47 +00:00
..
casts Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
functions Don't emit too_many_lines for closures 2021-08-05 15:38:57 +02:00
loops Fix while_let_on_iterator 2021-07-31 09:32:54 -04:00
methods Auto merge of #7542 - LeSeulArtichaut:cleanups, r=flip1995 2021-08-09 13:48:47 +00:00
misc_early Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
transmute Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
types Add missing backtick in docs for redundant_allocation 2021-08-05 19:06:35 +02:00
unit_types Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
utils Updated define_Conf! to support multi-line doc comments 2021-08-02 17:56:09 +02:00
absurd_extreme_comparisons.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
approx_const.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
arithmetic.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
as_conversions.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
asm_syntax.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
assertions_on_constants.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
assign_ops.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
async_yields_async.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
atomic_ordering.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
attrs.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
await_holding_invalid.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
bit_mask.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
blacklisted_name.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
blocks_in_if_conditions.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
bool_assert_comparison.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
booleans.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
bytecount.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
cargo_common_metadata.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
case_sensitive_file_extension_comparisons.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
checked_conversions.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
cognitive_complexity.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
collapsible_if.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
collapsible_match.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
comparison_chain.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
copies.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
copy_iterator.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
create_dir.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
dbg_macro.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
default.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
default_numeric_fallback.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
deprecated_lints.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
dereference.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
derive.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
disallowed_method.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
disallowed_script_idents.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
disallowed_type.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
doc.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
double_comparison.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
double_parens.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
drop_forget_ref.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
duration_subsec.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
else_if_without_else.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
empty_enum.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
entry.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
enum_clike.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
enum_variants.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
eq_op.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
erasing_op.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
escape.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
eta_reduction.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
eval_order_dependence.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
excessive_bools.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
exhaustive_items.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
exit.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
explicit_write.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
fallible_impl_from.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
float_equality_without_abs.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
float_literal.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
floating_point_arithmetic.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
format.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
formatting.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
from_over_into.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
from_str_radix_10.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
future_not_send.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
get_last_with_len.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
identity_op.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
if_let_mutex.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
if_let_some_result.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
if_not_else.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
if_then_some_else_none.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
implicit_hasher.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-07-29 11:14:25 +02:00
implicit_return.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
implicit_saturating_sub.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
inconsistent_struct_constructor.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
indexing_slicing.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
infinite_iter.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
inherent_impl.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
inherent_to_string.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
inline_fn_without_body.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
int_plus_one.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
integer_division.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
invalid_upcast_comparisons.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
items_after_statements.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
large_const_arrays.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
large_enum_variant.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
large_stack_arrays.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
len_zero.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
let_if_seq.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
let_underscore.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
lib.rs merge XOR_SWAP with MANUAL_SWAP 2021-08-09 02:15:10 +04:30
lifetimes.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
literal_representation.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
macro_use.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
main_recursion.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_async_fn.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_map.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_non_exhaustive.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_ok_or.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_strip.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
manual_unwrap_or.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
map_clone.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
map_err_ignore.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
map_unit_fn.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
match_on_vec_items.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
matches.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mem_discriminant.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mem_forget.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mem_replace.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
minmax.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
misc.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
missing_const_for_fn.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
missing_doc.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-07-29 11:14:25 +02:00
missing_enforced_import_rename.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
missing_inline.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
modulo_arithmetic.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
multiple_crate_versions.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mut_key.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mut_mut.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mut_mutex_lock.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mut_reference.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mutable_debug_assertion.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
mutex_atomic.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_arbitrary_self_type.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_bitwise_bool.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_bool.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_borrow.rs needless_borrow: try to make lint example a bit more illustrating 2021-08-04 00:21:25 +02:00
needless_borrowed_ref.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_continue.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_for_each.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_pass_by_value.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_question_mark.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
needless_update.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
neg_cmp_op_on_partial_ord.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
neg_multiply.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
new_without_default.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
no_effect.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
non_copy_const.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
non_expressive_names.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
non_octal_unix_permissions.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
nonstandard_macro_braces.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
open_options.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
option_env_unwrap.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
option_if_let_else.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
overflow_check_conditional.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
panic_in_result_fn.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
panic_unimplemented.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
partialeq_ne_impl.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
pass_by_ref_or_value.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
path_buf_push_overwrite.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
pattern_type_mismatch.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
precedence.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
ptr.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
ptr_eq.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
ptr_offset_with_cast.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
question_mark.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
ranges.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_clone.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_closure_call.rs Use EarlyContext::sess instead of LintContext::sess() 2021-08-07 01:59:08 +02:00
redundant_else.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_field_names.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_pub_crate.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_slicing.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
redundant_static_lifetimes.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
ref_option_ref.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
reference.rs Replace span_to_snippet calls with snippet_opt from clippy_utils 2021-08-07 01:59:05 +02:00
regex.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
repeat_once.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
returns.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
self_assignment.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
self_named_constructors.rs Rename two lints to comply with our lint naming convention 2021-07-29 12:10:18 +02:00
semicolon_if_nothing_returned.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
serde_api.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
shadow.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
single_component_path_imports.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
size_of_in_element_count.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
slow_vector_initialization.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
stable_sort_primitive.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
strings.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
strlen_on_c_strings.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
suspicious_operation_groupings.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
suspicious_trait_impl.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
swap.rs merge XOR_SWAP with MANUAL_SWAP 2021-08-09 02:15:10 +04:30
tabs_in_doc_comments.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
temporary_assignment.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
to_digit_is_some.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
to_string_in_display.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
trait_bounds.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
transmuting_null.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
try_err.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
undropped_manually_drops.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unicode.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unit_return_expecting_ord.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unnamed_address.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unnecessary_self_imports.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unnecessary_sort_by.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unnecessary_wraps.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unnested_or_patterns.rs Remove or_patterns feature gate in example 2021-07-29 14:23:12 +02:00
unsafe_removed_from_name.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unused_async.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unused_io_amount.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unused_self.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unused_unit.rs Replace span_to_snippet calls with snippet_opt from clippy_utils 2021-08-07 01:59:05 +02:00
unwrap.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
unwrap_in_result.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
upper_case_acronyms.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
use_self.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-07-29 11:14:25 +02:00
useless_conversion.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
vec.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
vec_init_then_push.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
vec_resize_to_zero.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
verbose_file_reads.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
wildcard_dependencies.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
wildcard_imports.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
write.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
zero_div_zero.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00
zero_sized_map_values.rs Update lint documentation to use markdown headlines 2021-07-28 14:31:59 +02:00