@@ -111,207 +111,140 @@ missing_crate_level_docs = "warn"
111111# See also clippy.toml
112112[workspace .lints .clippy ]
113113all = { level = " warn" , priority = -1 }
114+ pedantic = { level = " warn" , priority = -1 }
114115
115116allow_attributes = " warn"
116117as_ptr_cast_mut = " warn"
117118await_holding_lock = " warn"
118- bool_to_int_with_if = " warn"
119119branches_sharing_code = " warn"
120- cast_possible_wrap = " warn"
121120char_lit_as_u8 = " warn"
122- checked_conversions = " warn"
123121clear_with_drain = " warn"
124122clone_on_ref_ptr = " warn"
125- cloned_instead_of_copied = " warn"
126123coerce_container_to_any = " warn"
127- comparison_chain = " warn"
128124dbg_macro = " warn"
129125debug_assert_with_mut_call = " warn"
130- decimal_bitwise_operands = " warn"
131126default_union_representation = " warn"
132127derive_partial_eq_without_eq = " warn"
133128disallowed_macros = " warn" # See clippy.toml
134129disallowed_methods = " warn" # See clippy.toml
135130disallowed_names = " warn" # See clippy.toml
136131disallowed_script_idents = " warn" # See clippy.toml
137132disallowed_types = " warn" # See clippy.toml
138- doc_broken_link = " warn"
139- doc_comment_double_space_linebreaks = " warn"
140133doc_include_without_cfg = " warn"
141- doc_link_with_quotes = " warn"
142- doc_markdown = " warn"
143- duration_suboptimal_units = " warn"
144- elidable_lifetime_names = " warn"
145134empty_enum_variants_with_brackets = " warn"
146- empty_enums = " warn"
147135empty_line_after_outer_attr = " warn"
148- enum_glob_use = " warn"
149136equatable_if_let = " warn"
150137exit = " warn"
151- expl_impl_clone_on_copy = " warn"
152- explicit_deref_methods = " warn"
153- explicit_into_iter_loop = " warn"
154- explicit_iter_loop = " warn"
155138expect_used = " warn"
156139fallible_impl_from = " warn"
157- filter_map_next = " warn"
158- flat_map_option = " warn"
159140float_cmp_const = " warn"
160- fn_params_excessive_bools = " warn"
161141fn_to_numeric_cast_any = " warn"
162- format_push_string = " warn"
163- from_iter_instead_of_collect = " warn"
164142get_unwrap = " warn"
165143if_let_mutex = " warn"
166- ignore_without_reason = " warn"
167- ignored_unit_patterns = " warn"
168- implicit_clone = " warn"
169144implied_bounds_in_impls = " warn"
170145imprecise_flops = " warn"
171- inconsistent_struct_constructor = " warn"
172- index_refutable_slice = " warn"
173- inefficient_to_string = " warn"
174146infinite_loop = " warn"
175- into_iter_without_iter = " warn"
176- invalid_upcast_comparisons = " warn"
177- ip_constant = " warn"
178- iter_filter_is_ok = " warn"
179- iter_filter_is_some = " warn"
180- iter_not_returning_iterator = " warn"
181147iter_on_empty_collections = " warn"
182148iter_on_single_items = " warn"
183149iter_over_hash_type = " warn"
184- iter_without_into_iter = " warn"
185- large_digit_groups = " warn"
186- large_futures = " warn"
187150large_include_file = " warn"
188- large_stack_arrays = " warn"
189151large_stack_frames = " warn"
190- large_types_passed_by_value = " warn"
191152let_underscore_must_use = " warn"
192153let_underscore_untyped = " warn"
193154let_unit_value = " warn"
194- linkedlist = " warn"
195155literal_string_with_formatting_args = " warn"
196156lossy_float_literal = " warn"
197- macro_use_imports = " warn"
198- manual_assert = " warn"
199157manual_clamp = " warn"
200158manual_ilog2 = " warn"
201- manual_instant_elapsed = " warn"
202- manual_is_power_of_two = " warn"
203- manual_is_variant_and = " warn"
204- manual_let_else = " warn"
205- manual_midpoint = " warn"
206159manual_ok_or = " warn"
207- manual_string_new = " warn"
208160map_err_ignore = " warn"
209161map_flatten = " warn"
210- match_bool = " warn"
211- match_same_arms = " warn"
212- match_wild_err_arm = " warn"
213- match_wildcard_for_single_variants = " warn"
214162mem_forget = " warn"
215- mismatching_type_param_order = " warn"
216163missing_assert_message = " warn"
217164missing_enforced_import_renames = " warn"
218- missing_errors_doc = " warn"
219- missing_fields_in_debug = " warn"
220165missing_safety_doc = " warn"
221166mixed_attributes_style = " warn"
222- mut_mut = " warn"
223167mutex_integer = " warn"
224168needless_borrow = " warn"
225- needless_continue = " warn"
226- needless_for_each = " warn"
227169needless_pass_by_ref_mut = " warn"
228- needless_pass_by_value = " warn"
229- needless_raw_string_hashes = " warn"
230170needless_type_cast = " warn"
231171negative_feature_names = " warn"
232- non_std_lazy_statics = " warn"
233172non_zero_suggestions = " warn"
234173nonstandard_macro_braces = " warn"
235174only_used_in_recursion = " warn"
236- option_as_ref_cloned = " warn"
237- option_option = " warn"
238175or_fun_call = " warn"
239176path_buf_push_overwrite = " warn"
240177pathbuf_init_then_push = " warn"
241178precedence_bits = " warn"
242179print_stderr = " warn"
243180print_stdout = " warn"
244- ptr_as_ptr = " warn"
245- ptr_cast_constness = " warn"
246- pub_underscore_fields = " warn"
247181pub_without_shorthand = " warn"
248182rc_mutex = " warn"
249183readonly_write_lock = " warn"
250184redundant_type_annotations = " warn"
251- ref_as_ptr = " warn"
252- ref_option = " warn"
253- ref_option_ref = " warn"
254185ref_patterns = " warn"
255186rest_pat_in_fully_bound_structs = " warn"
256187return_and_then = " warn"
257- same_functions_in_if_condition = " warn"
258- same_length_and_capacity = " warn"
259- self_only_used_in_recursion = " warn"
260- semicolon_if_nothing_returned = " warn"
261188set_contains_or_insert = " warn"
262- should_panic_without_expect = " warn"
263- single_char_pattern = " warn"
264- single_match_else = " warn"
265189single_option_map = " warn"
266- str_split_at_newline = " warn"
267190str_to_string = " warn"
268191string_add = " warn"
269- string_add_assign = " warn"
270192string_lit_as_bytes = " warn"
271193string_lit_chars_any = " warn"
272194suspicious_command_arg_space = " warn"
273195suspicious_xor_used_as_pow = " warn"
274196todo = " warn"
275197too_long_first_doc_paragraph = " warn"
276198too_many_arguments = " warn"
277- too_many_lines = " warn"
278199trailing_empty_array = " warn"
279200trait_duplication_in_bounds = " warn"
280- transmute_ptr_to_ptr = " warn"
281201tuple_array_conversions = " warn"
282- unchecked_time_subtraction = " warn"
283202undocumented_unsafe_blocks = " warn"
284203unimplemented = " warn"
285204uninhabited_references = " warn"
286- uninlined_format_args = " warn"
287- unnecessary_box_returns = " warn"
288- unnecessary_debug_formatting = " warn"
289- unnecessary_literal_bound = " warn"
290205unnecessary_safety_comment = " warn"
291206unnecessary_safety_doc = " warn"
292207unnecessary_self_imports = " warn"
293- unnecessary_semicolon = " warn"
294208unnecessary_struct_initialization = " warn"
295- unnecessary_trailing_comma = " warn"
296- unnecessary_wraps = " warn"
297- unnested_or_patterns = " warn"
298- unused_async = " warn"
299209unused_peekable = " warn"
300210unused_rounding = " warn"
301- unused_self = " warn"
302211unused_trait_names = " warn"
303212unwrap_used = " warn"
304213use_self = " warn"
305214useless_let_if_seq = " warn"
306215useless_transmute = " warn"
307216verbose_file_reads = " warn"
308217wildcard_dependencies = " warn"
309- wildcard_imports = " warn"
310- zero_sized_map_values = " warn"
311218
219+ # Pedantic lints we opt out of, with the number of hits at the time we enabled `pedantic`.
220+ # Lints that were already enabled here one-by-one are kept on.
221+ cast_lossless = " allow" # 57 hits
222+ cast_possible_truncation = " allow" # 36 hits
223+ cast_precision_loss = " allow" # 38 hits
224+ cast_sign_loss = " allow" # 9 hits
225+ default_trait_access = " allow" # 12 hits
226+ float_cmp = " allow" # exact float comparisons are usually intentional (`float_cmp_const` is still on)
227+ inline_always = " allow" # we know what we are doing
228+ items_after_statements = " allow" # 3 hits
229+ many_single_char_names = " allow" # `r, g, b, a` and `h, s, v` are fine
230+ missing_panics_doc = " allow" # 2 hits
231+ must_use_candidate = " allow" # 181 hits
232+ redundant_closure_for_method_calls = " allow" # 13 hits
233+ return_self_not_must_use = " allow" # 194 hits
234+ similar_names = " allow" # too many false positives, e.g. `encoder`/`encoded`
235+ struct_excessive_bools = " allow" # 3 hits
236+ struct_field_names = " allow" # 3 hits
237+ trivially_copy_pass_by_ref = " allow" # 3 hits
238+ unreadable_literal = " allow"
239+ used_underscore_binding = " allow"
240+
241+ # These are meh:
312242assigning_clones = " allow" # No please
313243manual_range_contains = " allow" # this one is just worse imho
314244map_unwrap_or = " allow" # so is this one
245+
246+ # NOTE: these are in `restriction`/`nursery`, so the `allow` is a no-op today.
247+ # We keep them to record our intent in case we ever enable those groups.
315248self_named_module_files = " allow" # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
316249significant_drop_tightening = " allow" # Too many false positives
317250
0 commit comments