Theseus icon indicating copy to clipboard operation
Theseus copied to clipboard

Fix cargo clippy warnings

Open xa888s opened this issue 3 years ago • 18 comments

Note: to include all crates in the Theseus workspace, pass --workspace to the cargo command. This works for us:

cargo clean 
cargo clippy -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem --target cfg/x86_64-theseus.json --workspace

You can optionally include the --all-features argument at the end to include ALL crates, if desired.


Clippy Lint Status Tracker

This list is based on clippy for Rust v1.61.0, docs here: https://rust-lang.github.io/rust-clippy/rust-1.61.0/index.html

We don't need to support everything here, but it wouldn't hurt. Note that currently the Pedantic, Restriction, and Cargo categories of lints are not tracked here because they aren't desirable for Theseus's current level of stability. We can always add them in the future once the below lints are complete.

  • [ ] Complexity

    • [x] bind_instead_of_map
    • [x] bool_comparison
    • [x] borrowed_box
    • [x] bytes_count_to_len
    • [ ] char_lit_as_u8
    • [ ] clone_on_copy
    • [x] crosspointer_transmute
    • [x] deprecated_cfg_attr
    • [x] deref_addrof
    • [ ] derivable_impls
    • [x] diverging_sub_expression
    • [x] double_comparisons
    • [x] double_parens
    • [x] duration_subsec
    • [ ] explicit_counter_loop
    • [x] explicit_write
    • [x] extra_unused_lifetimes
    • [x] filter_map_identity
    • [x] filter_next
    • [x] flat_map_identity
    • [x] get_last_with_len
    • [ ] identity_op
    • [x] inspect_for_each
    • [ ] int_plus_one
    • [x] iter_count
    • [x] manual_filter_map
    • [x] manual_find_map
    • [ ] manual_flatten
    • [x] manual_split_once
    • [x] manual_strip
    • [x] manual_swap
    • [x] manual_unwrap_or
    • [x] map_flatten
    • [x] map_identity
    • [x] match_as_ref
    • [x] match_single_binding
    • [x] needless_arbitrary_self_type
    • [x] needless_bool
    • [x] needless_borrowed_reference
    • [ ] needless_lifetimes
    • [x] needless_match
    • [x] needless_option_as_deref
    • [x] needless_option_take
    • [ ] needless_question_mark
    • [x] needless_splitn
    • [x] needless_update
    • [x] neg_cmp_op_on_partial_ord
    • [x] no_effect
    • [x] nonminimal_bool
    • [x] option_as_ref_deref
    • [x] option_filter_map
    • [x] option_map_unit_fn
    • [x] or_then_unwrap
    • [x] overflow_check_conditional
    • [x] partialeq_ne_impl
    • [x] precedence
    • [ ] ptr_offset_with_cast
    • [x] range_zip_with_len
    • [x] redundant_closure_call
    • [x] redundant_slicing
    • [x] repeat_once
    • [x] result_map_unit_fn
    • [x] search_is_some
    • [x] short_circuit_statement
    • [x] single_element_loop
    • [x] skip_while_next
    • [x] string_from_utf8_as_bytes
    • [x] strlen_on_c_strings
    • [x] temporary_assignment
    • [ ] too_many_arguments
    • [x] transmute_bytes_to_str
    • [x] transmute_float_to_int
    • [x] transmute_int_to_bool
    • [x] transmute_int_to_char
    • [x] transmute_int_to_float
    • [x] transmute_num_to_bytes
    • [x] transmute_ptr_to_ref
    • [x] transmutes_expressible_as_ptr_casts
    • [ ] type_complexity
    • [x] unit_arg
    • [ ] unnecessary_cast
    • [x] unnecessary_filter_map
    • [x] unnecessary_find_map
    • [x] unnecessary_operation
    • [x] unnecessary_sort_by
    • [x] unnecessary_unwrap
    • [x] unneeded_wildcard_pattern
    • [x] useless_asref
    • [ ] useless_conversion
    • [ ] useless_format
    • [x] vec_box
    • [x] while_let_loop
    • [x] wildcard_in_or_patterns
    • [x] zero_divided_by_zero
    • [x] zero_prefixed_literal
  • [x] Correctness

    • [x] absurd_extreme_comparisons
    • [x] almost_swapped
    • [x] approx_constant
    • [x] async_yields_async
    • [x] bad_bit_mask
    • [x] cast_ref_to_mut
    • [x] cast_slice_different_sizes
    • [x] clone_double_ref
    • [x] cmp_nan
    • [x] deprecated_semver
    • [x] derive_hash_xor_eq
    • [x] derive_ord_xor_partial_ord
    • [x] drop_copy
    • [x] drop_ref
    • [x] enum_clike_unportable_variant
    • [x] eq_op
    • [x] erasing_op
    • [x] fn_address_comparisons
    • [x] forget_copy
    • [x] forget_ref
    • [x] if_let_mutex
    • [x] if_same_then_else
    • [x] ifs_same_cond
    • [x] ineffective_bit_mask
    • [x] infinite_iter
    • [x] inherent_to_string_shadow_display
    • [x] inline_fn_without_body
    • [x] invalid_null_ptr_usage
    • [x] invalid_regex
    • [x] invisible_characters
    • [x] iter_next_loop
    • [x] iterator_step_by_zero
    • [x] let_underscore_lock
    • [x] logic_bug
    • [x] match_str_case_mismatch
    • [x] mem_replace_with_uninit
    • [x] min_max
    • [x] mismatched_target_os
    • [x] mistyped_literal_suffixes
    • [x] modulo_one
    • [x] mut_from_ref
    • [x] never_loop
    • [x] non_octal_unix_permissions
    • [x] nonsensical_open_options
    • [x] not_unsafe_ptr_arg_deref
    • [x] option_env_unwrap
    • [x] out_of_bounds_indexing
    • [x] panicking_unwrap
    • [x] possible_missing_comma
    • [x] recursive_format_impl
    • [x] reversed_empty_ranges
    • [x] self_assignment
    • [x] serde_api_misuse
    • [x] size_of_in_element_count
    • [x] suspicious_splitn
    • [x] transmuting_null
    • [x] undropped_manually_drops
    • [x] uninit_assumed_init
    • [x] uninit_vec
    • [x] unit_cmp
    • [x] unit_hash
    • [x] unit_return_expecting_ord
    • [x] unsound_collection_transmute
    • [x] unused_io_amount
    • [x] useless_attribute
    • [x] vec_resize_to_zero
    • [x] vtable_address_comparisons
    • [x] while_immutable_condition
    • [x] wrong_transmute
    • [x] zst_offset
  • [ ] Style

    • [x] assertions_on_constants
    • [ ] assign_op_pattern
    • [x] blacklisted_name
    • [ ] blocks_in_if_conditions
    • [x] bool_assert_comparison
    • [x] borrow_interior_mutable_const
    • [x] builtin_type_shadow
    • [x] bytes_nth
    • [x] chars_last_cmp
    • [x] chars_next_cmp
    • [x] cmp_null
    • [ ] collapsible_else_if
    • [ ] collapsible_if
    • [ ] collapsible_match
    • [ ] comparison_chain
    • [ ] comparison_to_empty
    • [ ] declare_interior_mutable_const
    • [x] disallowed_methods
    • [x] disallowed_types
    • [x] double_must_use
    • [x] double_neg
    • [x] duplicate_underscore_argument
    • [x] enum_variant_names
    • [x] err_expect
    • [x] excessive_precision
    • [x] field_reassign_with_default
    • [ ] fn_to_numeric_cast
    • [x] fn_to_numeric_cast_with_truncation
    • [x] for_kv_map
    • [ ] from_over_into
    • [x] from_str_radix_10
    • [ ] inconsistent_digit_grouping
    • [x] infallible_destructuring_match
    • [x] inherent_to_string
    • [x] init_numbered_fields
    • [ ] into_iter_on_ref
    • [x] is_digit_ascii_radix
    • [x] iter_cloned_collect
    • [x] iter_next_slice
    • [ ] iter_nth_zero
    • [ ] iter_skip_next
    • [x] just_underscores_and_digits
    • [ ] len_without_is_empty
    • [ ] len_zero
    • [ ] let_and_return
    • [x] let_unit_value
    • [x] main_recursion
    • [x] manual_async_fn
    • [x] manual_bits
    • [x] manual_map
    • [x] manual_non_exhaustive
    • [ ] manual_range_contains
    • [x] manual_saturating_arithmetic
    • [ ] map_clone
    • [x] map_collect_result_unit
    • [ ] match_like_matches_macro
    • [x] match_overlapping_arm
    • [ ] match_ref_pats
    • [x] match_result_ok
    • [x] mem_replace_option_with_none
    • [ ] mem_replace_with_default
    • [ ] missing_safety_doc
    • [x] mixed_case_hex_literals
    • [x] module_inception
    • [x] must_use_unit
    • [x] mut_mutex_lock
    • [ ] needless_borrow
    • [ ] needless_doctest_main
    • [ ] needless_late_init
    • [ ] needless_range_loop
    • [ ] needless_return
    • [x] neg_multiply
    • [ ] new_ret_no_self
    • [ ] new_without_default
    • [x] ok_expect
    • [ ] op_ref
    • [x] option_map_or_none
    • [ ] print_literal
    • [x] print_with_newline
    • [ ] println_empty_string
    • [ ] ptr_arg
    • [ ] ptr_eq
    • [ ] question_mark
    • [ ] redundant_closure
    • [ ] redundant_field_names
    • [x] redundant_pattern
    • [ ] redundant_pattern_matching
    • [ ] redundant_static_lifetimes
    • [x] result_map_or_into_option
    • [ ] result_unit_err
    • [x] same_item_push
    • [x] self_named_constructors
    • [x] should_implement_trait
    • [x] single_char_add_str
    • [x] single_component_path_imports
    • [ ] single_match
    • [x] string_extend_chars
    • [ ] tabs_in_doc_comments
    • [x] to_digit_is_some
    • [ ] toplevel_ref_arg
    • [x] trim_split_whitespace
    • [x] unnecessary_fold
    • [ ] unnecessary_lazy_evaluations
    • [ ] unnecessary_mut_passed
    • [x] unnecessary_owned_empty_strings
    • [x] unsafe_removed_from_name
    • [ ] unused_unit
    • [ ] unusual_byte_groupings
    • [x] unwrap_or_else_default
    • [ ] upper_case_acronyms
    • [ ] while_let_on_iterator
    • [x] write_literal
    • [x] write_with_newline
    • [x] writeln_empty_string
    • [ ] wrong_self_convention ¶
    • [x] zero_ptr
  • [ ] Nursery

    • [x] empty_line_after_outer_attr
    • [x] fallible_impl_from
    • [x] mutex_integer
    • [ ] needless_borrow
    • [x] panicking_unwrap
    • [ ] range_plus_one
    • [x] unnecessary_unwrap
  • [ ] Perf

    • [x] box_collection
    • [x] boxed_local
    • [x] cmp_owned
    • [x] expect_fun_call
    • [x] extend_with_drain
    • [x] format_in_format_args
    • [ ] format_push_string
    • [x] iter_nth
    • [x] iter_overeager_cloned
    • [x] large_const_arrays
    • [ ] large_enum_variant
    • [x] manual_memcpy
    • [x] manual_str_repeat
    • [x] map_entry
    • [x] missing_spin_loop
    • [x] needless_collect
    • [x] or_fun_call
    • [x] redundant_allocation
    • [x] redundant_clone
    • [x] single_char_pattern
    • [x] slow_vector_initialization
    • [x] to_string_in_format_args
    • [x] unnecessary_to_owned
    • [x] useless_vec
    • [x] vec_init_then_push
  • [ ] Suspicious

    • [x] await_holding_invalid_type
    • [x] await_holding_lock
    • [x] await_holding_refcell_ref
    • [x] blanket_clippy_restriction_lints
    • [x] cast_abs_to_unsigned
    • [x] cast_enum_constructor
    • [x] cast_enum_truncation
    • [x] crate_in_macro_def
    • [x] drop_non_drop
    • [ ] empty_loop
    • [x] float_equality_without_abs
    • [x] for_loops_over_fallibles
    • [x] forget_non_drop
    • [x] misrefactored_assign_op
    • [x] mixed_read_write_in_expression
    • [x] mut_range_bound
    • [x] mutable_key_type
    • [x] octal_escapes
    • [x] print_in_format_impl
    • [x] suspicious_arithmetic_impl
    • [x] suspicious_assignment_formatting
    • [x] suspicious_else_formatting
    • [x] suspicious_map
    • [x] suspicious_op_assign_impl
    • [x] suspicious_unary_op_formatting

xa888s avatar Jun 10 '22 20:06 xa888s

Hi Brandon, thanks for bringing this up! Yep, this has definitely been on our to-do list for quite a while. I do use clippy in some cases but it's not yet integrated as part of the CI workflow, nor has it been used across the entire repo as a whole.

Kindly feel free to submit a series of PRs that address the linter issues, preferably on a per-subsystem basis. Try to keep the PRs smaller in scope so there aren't 6000+ changes to review in a single PR.

It'd also be great to have GitHub actions workflow that runs it on changed code, if you're so inclined.

kevinaboos avatar Jun 10 '22 20:06 kevinaboos

After some thought, I think the best way to do this is to add a new CI action that runs only a subset of approved clippy actions on newly-added (or modified) code only. This way we don't have to worry about retroactively applying 6000+ changes to the entire code base.

Also, this issue can serve as the tracking issue for integrating clippy lints into Theseus at large. We should add a long list of checkboxes to your initial post above, with each checkbox being a subset of available clippy lints. Then, when we have fixed all code such that it passes a given subset of clippy lints, we can check off those lints from the list. The first few can be the ones about unwrap_or vs unwrap_or_else, thanks to your PR #527.

We can take a similar approach to rustfmt, but I think that's a bit more complex and significantly lower priority. Let's definitely separate them though.

kevinaboos avatar Jun 13 '22 23:06 kevinaboos

@xa888s I added the full list of Clippy lints to your original post. Once you undo the rustfmt changes to #527 and we merge it in, you can check those boxes.

kevinaboos avatar Jun 15 '22 23:06 kevinaboos

!538 fixes these four, which are all deny-by-default (i.e. errors):

  1. enum_clike_unportable_variant
  2. derive_hash_xor_eq
  3. derive_ord_xor_partial_ord
  4. absurd_extreme_comparisons

jkugelman avatar Jun 17 '22 01:06 jkugelman

Hello! Would I be able to jump in and submit a PR or two to help work on this issue?

nramos0 avatar Jul 12 '22 18:07 nramos0

Hello! Would I be able to jump in and submit a PR or two to help work on this issue?

of course, we'd be grateful for any and all help!

kevinaboos avatar Jul 12 '22 18:07 kevinaboos

Thanks to @nramos0, PR #561 has fixed the following:

  • redundant-clone
  • or-fun-call
  • to-string-in-format-args
  • cmp-owned
  • single-char-pattern
  • vec-init-then-push
  • expect-fun-call

and PR #563 has fixed:

  • while-let-loop
  • bool-comparison
  • manual-unwrap-or
  • useless-asref
  • filter_next
  • nonminimal-bool
  • bind-instead-of-map

kevinaboos avatar Jul 14 '22 19:07 kevinaboos

@nramos0 since you're currently doing some great work on this issue, would you be interested in adding a GitHub actions pass that runs the above checked-off clippy lints on changed files in PRs? That way we'd avoid re-introducing code that violates the lints we've already marked as completed.

kevinaboos avatar Jul 14 '22 19:07 kevinaboos

@nramos0 since you're currently doing some great work on this issue, would you be interested in adding a GitHub actions pass that runs the above checked-off clippy lints on changed files in PRs? That way we'd avoid re-introducing code that violates the lints we've already marked as completed.

Sure, I'll give it a shot.

nramos0 avatar Jul 17 '22 11:07 nramos0

Sure, I'll give it a shot.

Fantastic! Let me know if we can help.

kevinaboos avatar Jul 21 '22 01:07 kevinaboos

When testing the github action for PR #574 I think I may have found another file that was not reached by the clippy build/check: applications/bm/src/lib.rs. It passed the check here, but the check correctly failed when changing another file here.

nramos0 avatar Jul 22 '22 19:07 nramos0

I ran the below on the main branch and didn't get any warnings about borrowed_box. Are the not checked off items inclusive of items that have never been tested? Can we update the list to check off all the items that do not exist (and add them to be checked against)?

$ cargo clean $ cargo clippy -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem --target cfg/x86_64-theseus.json --workspace -- -A clippy::all -D clippy::borrowed_box

I would be willing to run all the tests as above to confirm the issues actually exist.

Curiously however, I did get the one warning:

warning: unused import: frame_allocator::AllocatedFrames --> kernel/page_table_entry/src/lib.rs:20:5 | 20 | use frame_allocator::AllocatedFrames; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_imports)] on by default

warning: page_table_entry (lib) generated 1 warning

dcampbell24 avatar Sep 10 '22 19:09 dcampbell24

#636 found all the already passing complexity lints.

tsoutsman avatar Sep 12 '22 23:09 tsoutsman

Thanks @dcampbell24! Does this include all of the crates, even optional ones? (specified using make full or by passing --all-features to cargo)? I'm traveling at the moment and can't check myself.

kevinaboos avatar Sep 13 '22 09:09 kevinaboos

No @kevinaboos , I passed --workspace, but not make full or --all-features. When I run make full I see some warnings, but none of the ones specified in lints.txt. I don't see lints.txt mentioned anywhere in the Makefile, so I am a little confused. lints is mentioned, but in commented out code. Does running make full really cover everything? Can I uncomment lines in lints.txt then run make full. I was passing the argument directly to cargo similarly to what I pasted above.

dcampbell24 avatar Sep 13 '22 15:09 dcampbell24

I see. Yes, make commands don't run any clippy lints, that's only done via CI at the moment. Sorry to confuse you with that unrelated info. For this you'll just want to pass --all-features to the clippy invocation to ensure all crates are included.

kevinaboos avatar Sep 13 '22 20:09 kevinaboos

Thanks @dcampbell24! Does this include all of the crates, even optional ones? (specified using make full or by passing --all-features to cargo)? I'm traveling at the moment and can't check myself.

The PR CI run succeded, and it uses --all-features.

@dcampbell24 the CI uses lints.txt here.

tsoutsman avatar Sep 14 '22 01:09 tsoutsman

Thanks to @dcampbell24, the rest of the passing lints were readded in #638.

tsoutsman avatar Sep 16 '22 00:09 tsoutsman

The following lints are solved now:

  • [x] char_lit_as_u8
  • [x] manual_flatten
  • [x] assign_op_pattern
  • [x] collapsible_else_if
  • [x] collapsible_if
  • [x] collapsible_match
  • [x] comparison_to_empty
  • [x] println_empty_string
  • [x] question_mark
  • [x] toplevel_ref_arg
  • [x] unusual_byte_groupings
  • [x] while_let_on_iterator
  • [x] large_enum_variant

amab8901 avatar Jan 09 '23 12:01 amab8901

The following lints are solved now:

Thanks, I checked 'em off!

kevinaboos avatar Jan 10 '23 00:01 kevinaboos

Updated as of #795.

kevinaboos avatar Jan 10 '23 05:01 kevinaboos

Updated as of #798.

kevinaboos avatar Jan 11 '23 09:01 kevinaboos

Updated as of #805 and #806.

kevinaboos avatar Jan 13 '23 08:01 kevinaboos

Updated as of #812 and #818

kevinaboos avatar Jan 18 '23 05:01 kevinaboos

Updated as of #819

kevinaboos avatar Jan 27 '23 21:01 kevinaboos

Thanks to all that helped with this issue!

kevinaboos avatar Jan 28 '23 00:01 kevinaboos

I don't think this issue is finished yet. There are more lints that need to be fixed. I'll be working on it and send more PR:s in the coming future

amab8901 avatar Feb 10 '23 16:02 amab8901

Which ones? The full batch of lints previously listed in lints.txt have been addressed or ignored where suitable. so I assume you mean un-allowing certain lints?

kevinaboos avatar Feb 10 '23 17:02 kevinaboos

These ones:

$ cargo clippy
warning: redundant pattern matching, consider using `is_some()`
   --> kernel/frame_allocator/src/lib.rs:130:32
    |
130 |                         if let Some(_) = current.overlap(other) {
    |                         -------^^^^^^^------------------------- help: try this: `if current.overlap(other).is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

warning: `frame_allocator` (lib) generated 1 warning (run `cargo clippy --fix --lib -p frame_allocator` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
   --> kernel/crate_metadata/src/lib.rs:119:37
    |
119 | pub const MODULE_PREFIX_DELIMITER: &'static str = "#";
    |                                    -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
    = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: constants have by default a `'static` lifetime
   --> kernel/crate_metadata/src/lib.rs:121:34
    |
121 | pub const CRATE_HASH_DELIMITER: &'static str = "-";
    |                                 -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
   --> kernel/crate_metadata/src/lib.rs:124:36
    |
124 | pub const SECTION_HASH_DELIMITER: &'static str = "::h";
    |                                   -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: `crate_metadata` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p crate_metadata` to apply 3 suggestions)
warning: constants have by default a `'static` lifetime
  --> kernel/crate_name_utils/src/lib.rs:80:16
   |
80 |     const AS: &'static str = " as ";
   |               -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: `crate_name_utils` (lib) generated 1 warning (run `cargo clippy --fix --lib -p crate_name_utils` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
  --> kernel/mod_mgmt/src/lib.rs:37:39
   |
37 | pub const NAMESPACES_DIRECTORY_NAME: &'static str = "namespaces";
   |                                      -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: constants have by default a `'static` lifetime
  --> kernel/mod_mgmt/src/lib.rs:40:40
   |
40 | pub const EXTRA_FILES_DIRECTORY_NAME: &'static str = "extra_files";
   |                                       -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: redundant field names in struct initialization
    --> kernel/mod_mgmt/src/lib.rs:1104:13
     |
1104 |             crate_name:              crate_name,
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `crate_name`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
     = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1658:41
     |
1658 |         const TEXT_PREFIX:             &'static str = ".text.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1659:41
     |
1659 |         const UNLIKELY_PREFIX:         &'static str = "unlikely."; // the full section prefix is ".text.unlikely."
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1660:41
     |
1660 |         const RODATA_PREFIX:           &'static str = ".rodata.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1661:41
     |
1661 |         const DATA_PREFIX:             &'static str = ".data.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1662:41
     |
1662 |         const BSS_PREFIX:              &'static str = ".bss.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1663:41
     |
1663 |         const TLS_DATA_PREFIX:         &'static str = ".tdata.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1664:41
     |
1664 |         const TLS_BSS_PREFIX:          &'static str = ".tbss.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1666:41
     |
1666 |         const GCC_EXCEPT_TABLE_PREFIX: &'static str = ".gcc_except_table.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:1667:41
     |
1667 |         const EH_FRAME_NAME:           &'static str = ".eh_frame";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
    --> kernel/mod_mgmt/src/lib.rs:2173:51
     |
2173 | ...                   const DATARELRO: &'static str = ".data.rel.ro.";
     |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: redundant closure
   --> kernel/mod_mgmt/src/lib.rs:629:18
    |
629 |             .map(|c| CowArc::clone_shallow(c))
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `CowArc::clone_shallow`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: variables can be used directly in the `format!` string
    --> kernel/mod_mgmt/src/lib.rs:2701:40
     |
2701 |             let potential_crate_name = format!("{}-", potential_crate_name);
     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
     = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
     |
2701 -             let potential_crate_name = format!("{}-", potential_crate_name);
2701 +             let potential_crate_name = format!("{potential_crate_name}-");
     |

warning: variables can be used directly in the `format!` string
    --> kernel/mod_mgmt/src/lib.rs:2852:20
     |
2852 |             syms = format!("{}\n{}", syms, syms_recursive);
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
2852 -             syms = format!("{}\n{}", syms, syms_recursive);
2852 +             syms = format!("{syms}\n{syms_recursive}");
     |

warning: variables can be used directly in the `format!` string
    --> kernel/mod_mgmt/src/lib.rs:3000:40
     |
3000 |         dump_dependent_crates(&strong_crate, format!("{}  ", prefix));
     |                                              ^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
3000 -         dump_dependent_crates(&strong_crate, format!("{}  ", prefix));
3000 +         dump_dependent_crates(&strong_crate, format!("{prefix}  "));
     |

warning: variables can be used directly in the `format!` string
    --> kernel/mod_mgmt/src/lib.rs:3012:18
     |
3012 |                 let prefix = format!("{}  ", prefix); // add two spaces of indentation to the prefix
     |                              ^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
3012 -                 let prefix = format!("{}  ", prefix); // add two spaces of indentation to the prefix
3012 +                 let prefix = format!("{prefix}  "); // add two spaces of indentation to the prefix
     |

warning: `mod_mgmt` (lib) generated 18 warnings (run `cargo clippy --fix --lib -p mod_mgmt` to apply 18 suggestions)
warning: variables can be used directly in the `format!` string
   --> kernel/task/src/lib.rs:101:22
    |
101 |             .map(|m| format!("{}", m))
    |                      ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
101 -             .map(|m| format!("{}", m))
101 +             .map(|m| format!("{m}"))
    |

warning: variables can be used directly in the `format!` string
   --> kernel/task/src/lib.rs:184:40
    |
184 |             Self::Panic(panic_info) => write!(f, "Panicked at {}", panic_info),
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
184 -             Self::Panic(panic_info) => write!(f, "Panicked at {}", panic_info),
184 +             Self::Panic(panic_info) => write!(f, "Panicked at {panic_info}"),
    |

warning: variables can be used directly in the `format!` string
   --> kernel/task/src/lib.rs:185:40
    |
185 |             Self::Exception(num)    => write!(f, "Exception {:#X}({})", num, num),
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
185 -             Self::Exception(num)    => write!(f, "Exception {:#X}({})", num, num),
185 +             Self::Exception(num)    => write!(f, "Exception {num:#X}({num})"),
    |

warning: variables can be used directly in the `format!` string
   --> kernel/task/src/lib.rs:501:19
    |
501 |             name: format!("task_{}", task_id),
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
501 -             name: format!("task_{}", task_id),
501 +             name: format!("task_{task_id}"),
    |

warning: variables can be used directly in the `format!` string
    --> kernel/task/src/lib.rs:1466:27
     |
1466 |     bootstrap_task.name = format!("bootstrap_task_core_{}", apic_id);
     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1466 -     bootstrap_task.name = format!("bootstrap_task_core_{}", apic_id);
1466 +     bootstrap_task.name = format!("bootstrap_task_core_{apic_id}");
     |

warning: this returns a `Result<_, ()>`
    --> kernel/task/src/lib.rs:1536:5
     |
1536 |     pub fn with_current_task<F, R>(function: F) -> Result<R, ()>
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: use a custom `Error` type instead
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
     = note: `#[warn(clippy::result_unit_err)]` on by default

warning: this returns a `Result<_, ()>`
    --> kernel/task/src/lib.rs:1602:5
     |
1602 | /     pub fn init_current_task(
1603 | |         current_task_id: usize,
1604 | |         current_task: Option<TaskRef>,
1605 | |     ) -> Result<ExitableTaskRef, ()> {
     | |____________________________________^
     |
     = help: use a custom `Error` type instead
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/mutex_preemption/src/rwlock_preempt.rs:97:13
    |
97  | /             match self.try_read() {
98  | |                 Some(guard) => return guard,
99  | |                 _ => {}
100 | |             }
    | |_____________^ help: try this: `if let Some(guard) = self.try_read() { return guard }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/mutex_preemption/src/rwlock_preempt.rs:192:13
    |
192 | /             match self.try_write() {
193 | |                 Some(guard) => return guard,
194 | |                 _ => {}
195 | |             }
    | |_____________^ help: try this: `if let Some(guard) = self.try_write() { return guard }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match

warning: `task` (lib) generated 7 warnings (run `cargo clippy --fix --lib -p task` to apply 5 suggestions)
warning: `mutex_preemption` (lib) generated 2 warnings
warning: redundant field names in struct initialization
  --> kernel/runqueue_realtime/src/lib.rs:63:13
   |
63 |             taskref: taskref,
   |             ^^^^^^^^^^^^^^^^ help: replace it with: `taskref`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
  --> kernel/runqueue_realtime/src/lib.rs:64:13
   |
64 |             period: period,
   |             ^^^^^^^^^^^^^^ help: replace it with: `period`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/runqueue_realtime/src/lib.rs:284:9
    |
284 | /         match self.iter().position(|rt| rt.taskref == *task ) {
285 | |             Some(i) => {
286 | |                 if let Some(mut realtime_taskref) = self.remove(i) {
287 | |                     realtime_taskref.period = Some(period);
...   |
291 | |             None => {},
292 | |         };
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
284 ~         if let Some(i) = self.iter().position(|rt| rt.taskref == *task ) {
285 +             if let Some(mut realtime_taskref) = self.remove(i) {
286 +                 realtime_taskref.period = Some(period);
287 +                 self.insert_realtime_taskref_at_proper_location(realtime_taskref);
288 +             }
289 ~         };
    |

warning: `runqueue_realtime` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p runqueue_realtime` to apply 2 suggestions)
warning: redundant field names in struct initialization
  --> kernel/runqueue_priority/src/lib.rs:69:13
   |
69 |             taskref: taskref,
   |             ^^^^^^^^^^^^^^^^ help: replace it with: `taskref`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: unneeded unit return type
  --> kernel/runqueue_priority/src/lib.rs:77:49
   |
77 |     pub fn increment_context_switches(&mut self) -> (){
   |                                                 ^^^^^^ help: remove the `-> ()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
   = note: `#[warn(clippy::unused_unit)]` on by default

warning: redundant field names in struct initialization
  --> kernel/runqueue_round_robin/src/lib.rs:67:13
   |
67 |             taskref: taskref,
   |             ^^^^^^^^^^^^^^^^ help: replace it with: `taskref`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: `runqueue_priority` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p runqueue_priority` to apply 2 suggestions)
warning: `runqueue_round_robin` (lib) generated 1 warning (run `cargo clippy --fix --lib -p runqueue_round_robin` to apply 1 suggestion)
warning: redundant field names in struct initialization
   --> kernel/scheduler_priority/src/lib.rs:132:13
    |
132 |             idle_task  : idle_task, 
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `idle_task`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: `scheduler_priority` (lib) generated 1 warning (run `cargo clippy --fix --lib -p scheduler_priority` to apply 1 suggestion)
warning: this returns a `Result<_, ()>`
  --> kernel/external_unwind_info/src/lib.rs:96:1
   |
96 | / pub unsafe fn deregister_unwind_info(
97 | |     text_section_base_address: *mut u8
98 | | ) -> Result<(), ()> {
   | |___________________^
   |
   = help: use a custom `Error` type instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
   = note: `#[warn(clippy::result_unit_err)]` on by default

warning: `external_unwind_info` (lib) generated 1 warning
warning: variables can be used directly in the `format!` string
   --> kernel/app_io/src/lib.rs:215:28
    |
215 |                 .write_all(format!("{}", fmt_args).as_bytes())
    |                            ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
215 -                 .write_all(format!("{}", fmt_args).as_bytes())
215 +                 .write_all(format!("{fmt_args}").as_bytes())
    |

warning: `app_io` (lib) generated 1 warning (run `cargo clippy --fix --lib -p app_io` to apply 1 suggestion)
warning: variables can be used directly in the `format!` string
  --> kernel/unwind/src/registers.rs:46:28
   |
46 |                 Some(r) => write!(fmt, "[{}]: {:#X}, ", i, r)?,
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
46 -                 Some(r) => write!(fmt, "[{}]: {:#X}, ", i, r)?,
46 +                 Some(r) => write!(fmt, "[{i}]: {r:#X}, ")?,
   |

warning: redundant pattern matching, consider using `is_some()`
   --> kernel/unwind/src/lib.rs:300:32
    |
300 |                         if let Some(_) = prev_cfa_adjustment {
    |                         -------^^^^^^^---------------------- help: try this: `if prev_cfa_adjustment.is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

warning: redundant field names in struct initialization
   --> kernel/fault_log/src/lib.rs:113:13
    |
113 |             fault_type: fault_type,
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `fault_type`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant closure
   --> kernel/fault_log/src/lib.rs:193:49
    |
193 |     fe.address_accessed  = address_accessed.map(|address| VirtualAddress::new_canonical(address));
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `VirtualAddress::new_canonical`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: variables can be used directly in the `format!` string
   --> kernel/crate_swap/src/lib.rs:200:17
    |
200 |                 format!("cached_crates--{:?}", swap_requests), 
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
200 -                 format!("cached_crates--{:?}", swap_requests), 
200 +                 format!("cached_crates--{swap_requests:?}"), 
    |

warning: `unwind` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p unwind` to apply 2 suggestions)
warning: `fault_log` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p fault_log` to apply 2 suggestions)
warning: `crate_swap` (lib) generated 1 warning (run `cargo clippy --fix --lib -p crate_swap` to apply 1 suggestion)
warning: variables can be used directly in the `format!` string
  --> kernel/fault_crate_swap/src/lib.rs:90:33
   |
90 |         ).map_err(|invalid_req| format!("{:#?}", invalid_req))?;
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
90 -         ).map_err(|invalid_req| format!("{:#?}", invalid_req))?;
90 +         ).map_err(|invalid_req| format!("{invalid_req:#?}"))?;
   |

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/fault_crate_swap/src/lib.rs:355:9
    |
355 | /         match constant_offset_fix(&swap_ranges, bottom, top) {
356 | |             Err (e) => {
357 | |                 debug! {"Failed to perform constant offset fix for the stack for task {} due to {}", taskref.name, e.to_string()};
358 | |             },
359 | |             _ => {},
360 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
355 ~         if let Err (e) = constant_offset_fix(&swap_ranges, bottom, top) {
356 +             debug! {"Failed to perform constant offset fix for the stack for task {} due to {}", taskref.name, e.to_string()};
357 +         }
    |

warning: `fault_crate_swap` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p fault_crate_swap` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
   --> kernel/spawn/src/lib.rs:173:34
    |
173 | const ENTRY_POINT_SECTION_NAME: &'static str = "main";
    |                                 -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
    = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: variables can be used directly in the `format!` string
    --> kernel/spawn/src/lib.rs:1003:15
     |
1003 |         .name(format!("idle_task_core_{}", apic_id))
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
     = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
     |
1003 -         .name(format!("idle_task_core_{}", apic_id))
1003 +         .name(format!("idle_task_core_{apic_id}"))
     |

warning: constants have by default a `'static` lifetime
  --> kernel/acpi/madt/src/lib.rs:18:28
   |
18 | pub const MADT_SIGNATURE: &'static [u8; 4] = b"APIC";
   |                           -^^^^^^^-------- help: consider removing `'static`: `&[u8; 4]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: redundant field names in struct initialization
  --> kernel/acpi/madt/src/lib.rs:79:13
   |
79 |             table: table,
   |             ^^^^^^^^^^^^ help: replace it with: `table`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant closure
   --> kernel/acpi/madt/src/lib.rs:152:73
    |
152 |                         self.mapped_pages.as_type(self.offset).ok().map(|ent| MadtEntry::LocalApic(ent))
    |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `MadtEntry::LocalApic`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: redundant closure
   --> kernel/acpi/madt/src/lib.rs:155:73
    |
155 |                         self.mapped_pages.as_type(self.offset).ok().map(|ent| MadtEntry::IoApic(ent))
    |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `MadtEntry::IoApic`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/madt/src/lib.rs:158:73
    |
158 |                         self.mapped_pages.as_type(self.offset).ok().map(|ent| MadtEntry::IntSrcOverride(ent))
    |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `MadtEntry::IntSrcOverride`                                                                                                                                                                                      
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/madt/src/lib.rs:161:73
    |
161 |                         self.mapped_pages.as_type(self.offset).ok().map(|ent| MadtEntry::NonMaskableInterrupt(ent))
    |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `MadtEntry::NonMaskableInterrupt`                                                                                                                                                                          
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/madt/src/lib.rs:164:73
    |
164 |                         self.mapped_pages.as_type(self.offset).ok().map(|ent| MadtEntry::LocalApicAddressOverride(ent))
    |                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `MadtEntry::LocalApicAddressOverride`                                                                                                                                                                  
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: variables can be used directly in the `format!` string
   --> kernel/acpi/madt/src/lib.rs:327:56
    |
327 |                 Err(other_err) => return Err(Box::leak(format!("{:?}", other_err).into_boxed_str())),
    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
327 -                 Err(other_err) => return Err(Box::leak(format!("{:?}", other_err).into_boxed_str())),
327 +                 Err(other_err) => return Err(Box::leak(format!("{other_err:?}").into_boxed_str())),
    |

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/acpi/madt/src/lib.rs:401:9
    |
401 | /         match madt_entry {
402 | |             MadtEntry::NonMaskableInterrupt(nmi) => {
403 | |                 // NMI entries are based on the "processor" id, not the "apic_id"
404 | |                 // Return this Nmi entry if it's for the given lapic, or if it's for all lapics
...   |
409 | |             _ => {  }
410 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
401 ~         if let MadtEntry::NonMaskableInterrupt(nmi) = madt_entry {
402 +             // NMI entries are based on the "processor" id, not the "apic_id"
403 +             // Return this Nmi entry if it's for the given lapic, or if it's for all lapics
404 +             if nmi.processor == processor || nmi.processor == 0xFF  {
405 +                 return (nmi.lint, nmi.flags);
406 +             }
407 +         }
    |

warning: constants have by default a `'static` lifetime
  --> kernel/acpi/fadt/src/lib.rs:17:28
   |
17 | pub const FADT_SIGNATURE: &'static [u8; 4] = b"FACP";
   |                           -^^^^^^^-------- help: consider removing `'static`: `&[u8; 4]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: `spawn` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p spawn` to apply 2 suggestions)
warning: `madt` (lib) generated 9 warnings (run `cargo clippy --fix --lib -p madt` to apply 8 suggestions)
warning: `fadt` (lib) generated 1 warning (run `cargo clippy --fix --lib -p fadt` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
  --> kernel/acpi/dmar/src/lib.rs:40:28
   |
40 | pub const DMAR_SIGNATURE: &'static [u8; 4] = b"DMAR";
   |                           -^^^^^^^-------- help: consider removing `'static`: `&[u8; 4]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: redundant closure
   --> kernel/acpi/dmar/src/lib.rs:215:44
    |
215 |             1 => mp.as_type(mp_offset).map(|ent| Self::Rmrr(ent)),
    |                                            ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::Rmrr`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: redundant closure
   --> kernel/acpi/dmar/src/lib.rs:216:44
    |
216 |             2 => mp.as_type(mp_offset).map(|ent| Self::Atsr(ent)),
    |                                            ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::Atsr`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/dmar/src/lib.rs:217:44
    |
217 |             3 => mp.as_type(mp_offset).map(|ent| Self::Rhsa(ent)),
    |                                            ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::Rhsa`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/dmar/src/lib.rs:218:44
    |
218 |             4 => mp.as_type(mp_offset).map(|ent| Self::Andd(ent)),
    |                                            ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::Andd`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/acpi/dmar/src/lib.rs:219:44
    |
219 |             5 => mp.as_type(mp_offset).map(|ent| Self::Satc(ent)),
    |                                            ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::Satc`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: constants have by default a `'static` lifetime
  --> kernel/acpi/rsdt/src/lib.rs:27:28
   |
27 | pub const RSDT_SIGNATURE: &'static [u8; 4] = b"RSDT";
   |                           -^^^^^^^-------- help: consider removing `'static`: `&[u8; 4]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: constants have by default a `'static` lifetime
  --> kernel/acpi/rsdt/src/lib.rs:28:28
   |
28 | pub const XSDT_SIGNATURE: &'static [u8; 4] = b"XSDT";
   |                           -^^^^^^^-------- help: consider removing `'static`: `&[u8; 4]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
  --> kernel/acpi/rsdp/src/lib.rs:21:24
   |
21 | const RSDP_SIGNATURE: &'static [u8; 8] = b"RSD PTR ";
   |                       -^^^^^^^-------- help: consider removing `'static`: `&[u8; 8]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: name `CFI` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:162:5
    |
162 |     CFI   = 1 << 23,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Cfi`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
    = note: `#[warn(clippy::upper_case_acronyms)]` on by default

warning: name `SIRTP` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:164:5
    |
164 |     SIRTP = 1 << 24,
    |     ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Sirtp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `IRE` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:166:5
    |
166 |     IRE   = 1 << 25,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Ire`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `QIE` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:168:5
    |
168 |     QIE   = 1 << 26,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Qie`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `WBF` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:170:5
    |
170 |     WBF   = 1 << 27,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Wbf`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `EAFL` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:172:5
    |
172 |     EAFL  = 1 << 28,
    |     ^^^^ help: consider making the acronym lowercase, except the initial letter: `Eafl`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `SFL` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:174:5
    |
174 |     SFL   = 1 << 29,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Sfl`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: name `SRTP` contains a capitalized acronym
   --> kernel/iommu/src/regs.rs:176:5
    |
176 |     SRTP  = 1 << 30,
    |     ^^^^ help: consider making the acronym lowercase, except the initial letter: `Srtp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: `dmar` (lib) generated 6 warnings (run `cargo clippy --fix --lib -p dmar` to apply 6 suggestions)
warning: `rsdt` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p rsdt` to apply 2 suggestions)
warning: `rsdp` (lib) generated 1 warning (run `cargo clippy --fix --lib -p rsdp` to apply 1 suggestion)
warning: `iommu` (lib) generated 8 warnings
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/acpi/src/lib.rs:109:17
    |
109 | /                 match table {
110 | |                     dmar::DmarEntry::Drhd(drhd) => {
111 | |                         debug!("Found DRHD table: INCLUDE_PCI_ALL: {:?}, segment_number: {:#X}, register_base_address: {:#X}", 
112 | |                             drhd.include_pci_all(), drhd.segment_number(), drhd.register_base_address(),
...   |
134 | |                     _ => { }
135 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
109 ~                 if let dmar::DmarEntry::Drhd(drhd) = table {
110 +                     debug!("Found DRHD table: INCLUDE_PCI_ALL: {:?}, segment_number: {:#X}, register_base_address: {:#X}", 
111 +                         drhd.include_pci_all(), drhd.segment_number(), drhd.register_base_address(),
112 +                     );
113 +                     if !drhd.include_pci_all() {
114 +                         info!("No IOMMU support when INCLUDE_PCI_ALL not set in DRHD");
115 +                     } else {
116 +                         let register_base_address = PhysicalAddress::new(drhd.register_base_address() as usize)
117 +                             .ok_or("IOMMU register_base_address was invalid")?;
118 +                         iommu::init(
119 +                             dmar_table.host_address_width(),
120 +                             drhd.segment_number(), 
121 +                             register_base_address,
122 +                             page_table
123 +                         )?;
124 +                     }
125 +                     debug!("DRHD table has Device Scope entries:");
126 +                     for (_idx, dev_scope) in drhd.iter().enumerate() {
127 +                         debug!("    Device Scope [{}]: type: {}, enumeration_id: {}, start_bus_number: {}", 
128 +                             _idx, dev_scope.device_type(), dev_scope.enumeration_id(), dev_scope.start_bus_number(),
129 +                         );
130 +                         debug!("                  path: {:?}", dev_scope.path());
131 +                     }
132 +                 }
    |

warning: this returns a `Result<_, ()>`
   --> kernel/page_attribute_table/src/lib.rs:148:1
    |
148 | pub fn init() -> Result<(), ()> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use a custom `Error` type instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
    = note: `#[warn(clippy::result_unit_err)]` on by default

warning: `acpi` (lib) generated 1 warning
warning: `page_attribute_table` (lib) generated 1 warning
warning: redundant field names in struct initialization
   --> kernel/pci/src/lib.rs:150:21
    |
150 |                     vendor_id:        vendor_id,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `vendor_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> kernel/pci/src/lib.rs:172:21
    |
172 |                     location:              location,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `location`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: redundant closure
  --> kernel/pci/src/lib.rs:80:26
   |
80 |     PCI_BUSES.call_once( || scan_pci() )
   |                          ^^^^^^^^^^^^^ help: replace the closure with the function itself: `scan_pci`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
   = note: `#[warn(clippy::redundant_closure)]` on by default

warning: variables can be used directly in the `format!` string
   --> kernel/pci/src/lib.rs:326:9
    |
326 |         write!(f, "{}", self)
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
326 -         write!(f, "{}", self)
326 +         write!(f, "{self}")
    |

warning: `pci` (lib) generated 4 warnings (run `cargo clippy --fix --lib -p pci` to apply 4 suggestions)
warning: redundant closure
   --> kernel/deferred_interrupt_tasks/src/lib.rs:142:24
    |
142 |     tb.spawn().map_err(|e| InterruptRegistrationError::SpawnError(e))
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `InterruptRegistrationError::SpawnError`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: `deferred_interrupt_tasks` (lib) generated 1 warning (run `cargo clippy --fix --lib -p deferred_interrupt_tasks` to apply 1 suggestion)
warning: redundant field names in struct initialization
   --> kernel/window_manager/src/lib.rs:146:17
    |
146 |                 top_left: top_left,
    |                 ^^^^^^^^^^^^^^^^^^ help: replace it with: `top_left`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> kernel/window_manager/src/lib.rs:191:17
    |
191 |                 top_left: top_left,
    |                 ^^^^^^^^^^^^^^^^^^ help: replace it with: `top_left`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: redundant field names in struct initialization
   --> kernel/window_manager/src/lib.rs:192:17
    |
192 |                 bottom_right: bottom_right
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `bottom_right`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/window_manager/src/lib.rs:126:9
    |
126 | /         match self.is_window_in_show_list(inner_ref) {
127 | |             // remove item in current list
128 | |             Some(i) => {
129 | |                 self.show_list.remove(i);
130 | |             }
131 | |             None => {}
132 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
126 ~         if let Some(i) = self.is_window_in_show_list(inner_ref) {
127 +             self.show_list.remove(i);
128 +         }
    |

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/window_manager/src/lib.rs:133:9
    |
133 | /         match self.is_window_in_hide_list(inner_ref) {
134 | |             // remove item in current list
135 | |             Some(i) => {
136 | |                 self.hide_list.remove(i);
137 | |             }
138 | |             None => {}
139 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try this
    |
133 ~         if let Some(i) = self.is_window_in_hide_list(inner_ref) {
134 +             self.hide_list.remove(i);
135 +         }
    |

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/window_manager/src/lib.rs:405:9
    |
405 | /         match self.repositioned_border {
406 | |             Some(border) => {
407 | |                 let pixels = self.draw_floating_border(&border, color::TRANSPARENT);
408 | |                 self.refresh_bottom_windows(pixels.into_iter(), true)?;
409 | |             },
410 | |             None =>{}
411 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try this
    |
405 ~         if let Some(border) = self.repositioned_border {
406 +             let pixels = self.draw_floating_border(&border, color::TRANSPARENT);
407 +             self.refresh_bottom_windows(pixels.into_iter(), true)?;
408 +         }
    |

warning: redundant pattern matching, consider using `is_err()`
   --> kernel/window_manager/src/lib.rs:805:12
    |
805 |     if let Err(_) = wm.pass_mouse_event_to_window(mouse_event) {
    |     -------^^^^^^--------------------------------------------- help: try this: `if wm.pass_mouse_event_to_window(mouse_event).is_err()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

warning: redundant field names in struct initialization
   --> kernel/framebuffer_printer/src/lib.rs:119:9
    |
119 |         top_left: top_left,
    |         ^^^^^^^^^^^^^^^^^^ help: replace it with: `top_left`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> kernel/framebuffer_printer/src/lib.rs:120:9
    |
120 |         bottom_right: bottom_right,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `bottom_right`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: name `ASCII` contains a capitalized acronym
  --> kernel/framebuffer_printer/src/lib.rs:17:6
   |
17 | type ASCII = u8;
   |      ^^^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ascii`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
   = note: `#[warn(clippy::upper_case_acronyms)]` on by default

warning: `window_manager` (lib) generated 7 warnings (run `cargo clippy --fix --lib -p window_manager` to apply 4 suggestions)
warning: `framebuffer_printer` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p framebuffer_printer` to apply 2 suggestions)
warning: redundant field names in struct initialization
  --> kernel/displayable/text_display/src/lib.rs:99:13
   |
99 |             width: width,
   |             ^^^^^^^^^^^^ help: replace it with: `width`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> kernel/displayable/text_display/src/lib.rs:100:13
    |
100 |             height: height,
    |             ^^^^^^^^^^^^^^ help: replace it with: `height`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: redundant field names in struct initialization
   --> kernel/displayable/text_display/src/lib.rs:104:13
    |
104 |             fg_color: fg_color,
    |             ^^^^^^^^^^^^^^^^^^ help: replace it with: `fg_color`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: redundant field names in struct initialization
   --> kernel/displayable/text_display/src/lib.rs:105:13
    |
105 |             bg_color: bg_color,
    |             ^^^^^^^^^^^^^^^^^^ help: replace it with: `bg_color`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: `text_display` (lib) generated 4 warnings (run `cargo clippy --fix --lib -p text_display` to apply 4 suggestions)
warning: constants have by default a `'static` lifetime
 --> kernel/stack_trace_frame_pointers/build.rs:5:20
  |
5 | const CFG_PREFIX: &'static str = "cargo:rustc-cfg=";
  |                   -^^^^^^^---- help: consider removing `'static`: `&str`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
  = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: variables can be used directly in the `format!` string
  --> kernel/stack_trace_frame_pointers/build.rs:17:13
   |
17 |             println!("{}frame pointers", CFG_PREFIX);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
17 -             println!("{}frame pointers", CFG_PREFIX);
17 +             println!("{CFG_PREFIX}frame pointers");
   |

warning: `stack_trace_frame_pointers` (build script) generated 2 warnings
warning: redundant field names in struct initialization
   --> kernel/libterm/src/cursor.rs:112:13
    |
112 |             top_left: top_left,
    |             ^^^^^^^^^^^^^^^^^^ help: replace it with: `top_left`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1070:18
     |
1070 |             .and_then(|s| write!(f, "{}", s))
     |                           ^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
     = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
     |
1070 -             .and_then(|s| write!(f, "{}", s))
1070 +             .and_then(|s| write!(f, "{s}"))
     |

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1075:3
     |
1075 |         write!(f, "\"{}\"", self)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1075 -         write!(f, "\"{}\"", self)
1075 +         write!(f, "\"{self}\"")
     |

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1096:18
     |
1096 |             .and_then(|s| write!(f, "{}", s))
     |                           ^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1096 -             .and_then(|s| write!(f, "{}", s))
1096 +             .and_then(|s| write!(f, "{s}"))
     |

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1101:3
     |
1101 |         write!(f, "\"{}\"", self)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1101 -         write!(f, "\"{}\"", self)
1101 +         write!(f, "\"{self}\"")
     |

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1117:18
     |
1117 |             .and_then(|s| write!(f, "{}", s))
     |                           ^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1117 -             .and_then(|s| write!(f, "{}", s))
1117 +             .and_then(|s| write!(f, "{s}"))
     |

warning: variables can be used directly in the `format!` string
    --> kernel/ata/src/lib.rs:1122:3
     |
1122 |         write!(f, "\"{}\"", self)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1122 -         write!(f, "\"{}\"", self)
1122 +         write!(f, "\"{self}\"")
     |

warning: `libterm` (lib) generated 1 warning (run `cargo clippy --fix --lib -p libterm` to apply 1 suggestion)
warning: `ata` (lib) generated 6 warnings (run `cargo clippy --fix --lib -p ata` to apply 6 suggestions)
warning: redundant field names in struct initialization
   --> kernel/mlx_ethernet/src/command_queue.rs:581:13
    |
581 |             opcode: opcode, 
    |             ^^^^^^^^^^^^^^ help: replace it with: `opcode`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: name `PMTU` contains a capitalized acronym
   --> kernel/mlx_ethernet/src/command_queue.rs:480:5
    |
480 |     PMTU = 0x5003,
    |     ^^^^ help: consider making the acronym lowercase, except the initial letter: `Pmtu`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
    = note: `#[warn(clippy::upper_case_acronyms)]` on by default

warning: name `TIR` contains a capitalized acronym
   --> kernel/mlx_ethernet/src/flow_table.rs:218:5
    |
218 |     TIR             = 0x2,
    |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Tir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

warning: variables can be used directly in the `format!` string
  --> kernel/smoltcp_helper/src/lib.rs:83:49
   |
83 |         iface.lock().ip_addrs().get(0).map(|ip| format!("{}", ip)).unwrap_or_else(|| "ERROR".to_string()),
   |                                                 ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
83 -         iface.lock().ip_addrs().get(0).map(|ip| format!("{}", ip)).unwrap_or_else(|| "ERROR".to_string()),
83 +         iface.lock().ip_addrs().get(0).map(|ip| format!("{ip}")).unwrap_or_else(|| "ERROR".to_string()),
   |

warning: variables can be used directly in the `format!` string
   --> kernel/serial_port/src/lib.rs:174:18
    |
174 |             Some(format!("serial_port_deferred_task_irq_{:#X}", interrupt_number)),
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
174 -             Some(format!("serial_port_deferred_task_irq_{:#X}", interrupt_number)),
174 +             Some(format!("serial_port_deferred_task_irq_{interrupt_number:#X}")),
    |

warning: this returns a `Result<_, ()>`
   --> kernel/serial_port/src/lib.rs:226:5
    |
226 | /     pub fn set_data_sender(
227 | |         &mut self,
228 | |         sender: Sender<DataChunk>
229 | |     ) -> Result<(), ()> {
    | |_______________________^
    |
    = help: use a custom `Error` type instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
    = note: `#[warn(clippy::result_unit_err)]` on by default

warning: `mlx_ethernet` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p mlx_ethernet` to apply 1 suggestion)
warning: `smoltcp_helper` (lib) generated 1 warning (run `cargo clippy --fix --lib -p smoltcp_helper` to apply 1 suggestion)
warning: `serial_port` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p serial_port` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
 --> kernel/panic_wrapper/../stack_trace_frame_pointers/build.rs:5:20
  |
5 | const CFG_PREFIX: &'static str = "cargo:rustc-cfg=";
  |                   -^^^^^^^---- help: consider removing `'static`: `&str`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
  = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: variables can be used directly in the `format!` string
  --> kernel/panic_wrapper/../stack_trace_frame_pointers/build.rs:17:13
   |
17 |             println!("{}frame pointers", CFG_PREFIX);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
17 -             println!("{}frame pointers", CFG_PREFIX);
17 +             println!("{CFG_PREFIX}frame pointers");
   |

warning: redundant field names in struct initialization
   --> kernel/mlx5/src/lib.rs:634:13
    |
634 |             send_completion_queue: send_completion_queue,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `send_completion_queue`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: `panic_wrapper` (build script) generated 2 warnings
warning: `mlx5` (lib) generated 1 warning (run `cargo clippy --fix --lib -p mlx5` to apply 1 suggestion)
warning: redundant field names in struct initialization
   --> kernel/http_client/src/lib.rs:124:13
    |
124 |             iface: iface,
    |             ^^^^^^^^^^^^ help: replace it with: `iface`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: redundant field names in struct initialization
   --> kernel/http_client/src/lib.rs:125:13
    |
125 |             sockets: sockets,
    |             ^^^^^^^^^^^^^^^^ help: replace it with: `sockets`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

warning: redundant closure
   --> kernel/http_client/src/lib.rs:218:71
    |
218 | ...                   response_reason = response.reason.map(|s| String::from(s));
    |                                                             ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `String::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: variables can be used directly in the `format!` string
  --> kernel/console/src/lib.rs:82:19
   |
82 |             .name(format!("{:?}_manager", serial_port_address))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
82 -             .name(format!("{:?}_manager", serial_port_address))
82 +             .name(format!("{serial_port_address:?}_manager"))
   |

warning: variables can be used directly in the `format!` string
   --> kernel/console/src/lib.rs:106:15
    |
106 |         .name(format!("tty_to_{:?}", address))
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
106 -         .name(format!("tty_to_{:?}", address))
106 +         .name(format!("tty_to_{address:?}"))
    |

warning: variables can be used directly in the `format!` string
   --> kernel/console/src/lib.rs:109:15
    |
109 |         .name(format!("{:?}_to_tty", address))
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
109 -         .name(format!("{:?}_to_tty", address))
109 +         .name(format!("{address:?}_to_tty"))
    |

warning: variables can be used directly in the `format!` string
   --> kernel/console/src/lib.rs:120:15
    |
120 |         .name(format!("{:?}_shell", address))
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
120 -         .name(format!("{:?}_shell", address))
120 +         .name(format!("{address:?}_shell"))
    |

warning: `http_client` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p http_client` to apply 3 suggestions)
warning: `console` (lib) generated 4 warnings (run `cargo clippy --fix --lib -p console` to apply 4 suggestions)
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> applications/shell/src/lib.rs:516:17
    |
516 | /                 match self.jobs.get(fg_job_num) {
517 | |                     Some(job) => {
518 | |                         self.terminal.lock().print_to_terminal("\n".to_string());
519 | |                         let mut buffered_string = String::new();
...   |
525 | |                     _ => {}
526 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
516 ~                 if let Some(job) = self.jobs.get(fg_job_num) {
517 +                     self.terminal.lock().print_to_terminal("\n".to_string());
518 +                     let mut buffered_string = String::new();
519 +                     mem::swap(&mut buffered_string, &mut self.input_buffer);
520 +                     buffered_string.push('\n');
521 +                     job.stdin_writer.lock().write_all(buffered_string.as_bytes())
522 +                         .or(Err("shell failed to write to stdin"))?;
523 +                 }
    |

warning: variables can be used directly in the `format!` string
   --> applications/shell/src/lib.rs:642:30
    |
642 |         let cmd_crate_name = format!("{}-", cmd);
    |                              ^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
642 -         let cmd_crate_name = format!("{}-", cmd);
642 +         let cmd_crate_name = format!("{cmd}-");
    |

warning: variables can be used directly in the `format!` string
   --> applications/shell/src/lib.rs:782:29
    |
782 | ...                   format!("{:?} command not found.\n", command)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
782 -                             format!("{:?} command not found.\n", command)
782 +                             format!("{command:?} command not found.\n")
    |

warning: variables can be used directly in the `format!` string
   --> applications/shell/src/lib.rs:786:50
    |
786 |                     AppErr::SpawnErr(e)       => format!("Failed to spawn new task to run command. Error: {}.\n", e),
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
786 -                     AppErr::SpawnErr(e)       => format!("Failed to spawn new task to run command. Error: {}.\n", e),
786 +                     AppErr::SpawnErr(e)       => format!("Failed to spawn new task to run command. Error: {e}.\n"),
    |

warning: variables can be used directly in the `format!` string
   --> applications/shell/src/lib.rs:790:60
    |
790 |                     self.terminal.lock().print_to_terminal(format!("{}\n", msg));
    |                                                            ^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
790 -                     self.terminal.lock().print_to_terminal(format!("{}\n", msg));
790 +                     self.terminal.lock().print_to_terminal(format!("{msg}\n"));
    |

warning: writing `&String` instead of `&str` involves a new object where a slice will do
   --> applications/shell/src/lib.rs:813:55
    |
813 |     fn find_app_name_match(&mut self, incomplete_cmd: &String) -> Result<Vec<String>, &'static str> {
    |                                                       ^^^^^^^ help: change this to: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
    = note: `#[warn(clippy::ptr_arg)]` on by default

warning: writing `&String` instead of `&str` involves a new object where a slice will do
   --> applications/shell/src/lib.rs:839:56
    |
839 |     fn find_file_path_match(&mut self, incomplete_cmd: &String) -> Result<Vec<String>, &'static str> {
    |                                                        ^^^^^^^ help: change this to: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: redundant pattern matching, consider using `is_some()`
   --> applications/shell/src/lib.rs:887:24
    |
887 |                 if let Some(_) = locked_working_dir.get_file(child) {
    |                 -------^^^^^^^------------------------------------- help: try this: `if locked_working_dir.get_file(child).is_some()`
    |
    = note: this will change drop order of the result, as well as all temporaries
    = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
    = note: `#[warn(clippy::redundant_pattern_matching)]` on by default

warning: redundant pattern matching, consider using `is_some()`
   --> applications/shell/src/lib.rs:889:31
    |
889 |                 } else if let Some (_) = locked_working_dir.get_dir(child) {
    |                        -------^^^^^^^^------------------------------------ help: try this: `if locked_working_dir.get_dir(child).is_some()`
    |
    = note: this will change drop order of the result, as well as all temporaries
    = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1039:37
     |
1039 | ...                   format!("task [{}] exited with code {} ({:#X})\n", exited_task_id, val, val)
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1039 -                                     format!("task [{}] exited with code {} ({:#X})\n", exited_task_id, val, val)
1039 +                                     format!("task [{exited_task_id}] exited with code {val} ({val:#X})\n")
     |

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1052:33
     |
1052 | ...                   format!("task [{}] was killed because {:?}\n", exited_task_id, kill_reason)
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1052 -                                 format!("task [{}] was killed because {:?}\n", exited_task_id, kill_reason)
1052 +                                 format!("task [{exited_task_id}] was killed because {kill_reason:?}\n")
     |

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1056:43
     |
1056 |   ...                   let err_msg = format!("Failed to `join` task [{}] {:?}, error: {:?}",
     |  _____________________________________^
1057 | | ...                       exited_task_id, task_ref, _e,
1058 | | ...                   );
     | |_______________________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1173:18
     |
1173 |         prompt = format!("{}: ",prompt);
     |                  ^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1173 -         prompt = format!("{}: ",prompt);
1173 +         prompt = format!("{prompt}: ");
     |

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
    --> applications/shell/src/lib.rs:1184:13
     |
1184 | /             match print_event.deref() {
1185 | |                 Event::OutputEvent(ref s) => {
1186 | |                     self.terminal.lock().print_to_terminal(s.clone());
1187 | |                 },
1188 | |                 _ => { },
1189 | |             }
     | |_____________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try this
     |
1184 ~             if let Event::OutputEvent(ref s) = print_event.deref() {
1185 +                 self.terminal.lock().print_to_terminal(s.clone());
1186 +             }
     |

warning: redundant pattern matching, consider using `is_err()`
    --> applications/shell/src/lib.rs:1403:32
     |
1403 |                         if let Err(_) = task_ref.unblock() {
     |                         -------^^^^^^--------------------- help: try this: `if task_ref.unblock().is_err()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1413:56
     |
1413 |                 self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
     |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1413 -                 self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
1413 +                 self.terminal.lock().print_to_terminal(format!("No job number {job_num} found!\n"));
     |

warning: redundant pattern matching, consider using `is_err()`
    --> applications/shell/src/lib.rs:1437:32
     |
1437 |                         if let Err(_) = task_ref.unblock() {
     |                         -------^^^^^^--------------------- help: try this: `if task_ref.unblock().is_err()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching

warning: variables can be used directly in the `format!` string
    --> applications/shell/src/lib.rs:1445:56
     |
1445 |                 self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
     |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
     |
1445 -                 self.terminal.lock().print_to_terminal(format!("No job number {} found!\n", job_num));
1445 +                 self.terminal.lock().print_to_terminal(format!("No job number {job_num} found!\n"));
     |

warning: redundant field names in struct initialization
   --> kernel/ixgbe/src/lib.rs:369:17
    |
369 |                 id: id,
    |                 ^^^^^^ help: replace it with: `id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: the function `Self::read_mac_address_from_nic` doesn't need a mutable reference
   --> kernel/ixgbe/src/lib.rs:331:65
    |
331 |         let mac_addr_hardware = Self::read_mac_address_from_nic(&mut mapped_registers_mac);
    |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
    = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default

warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
   --> kernel/ixgbe/src/lib.rs:813:18
    |
813 |         rx_regs: &mut Vec<IxgbeRxQueueRegisters>,
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [IxgbeRxQueueRegisters]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
    = note: `#[warn(clippy::ptr_arg)]` on by default

warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
   --> kernel/ixgbe/src/lib.rs:899:18
    |
899 |         tx_regs: &mut Vec<IxgbeTxQueueRegisters>,
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [IxgbeTxQueueRegisters]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

warning: redundant closure
    --> kernel/ixgbe/src/lib.rs:1315:48
     |
1315 |     let packet = packet.map(Ok).unwrap_or_else(|| test_packets::create_dhcp_test_packet())?;
     |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `test_packets::create_dhcp_test_packet`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
     = note: `#[warn(clippy::redundant_closure)]` on by default

warning: `shell` (lib) generated 18 warnings (run `cargo clippy --fix --lib -p shell` to apply 12 suggestions)
warning: `ixgbe` (lib) generated 5 warnings (run `cargo clippy --fix --lib -p ixgbe` to apply 2 suggestions)
warning: redundant field names in struct initialization
   --> kernel/pmu_x86/src/lib.rs:601:9
    |
601 |         msr_mask: msr_mask, 
    |         ^^^^^^^^^^^^^^^^^^ help: replace it with: `msr_mask`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: using tabs in doc comments is not recommended
  --> kernel/pmu_x86/src/lib.rs:49:5
   |
49 | //!     // wait some time here
   |     ^^^^ help: consider using four spaces per tab
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments
   = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default

warning: using tabs in doc comments is not recommended
  --> kernel/pmu_x86/src/lib.rs:50:5
   |
50 | //!     
   |     ^^^^ help: consider using four spaces per tab
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments

warning: using tabs in doc comments is not recommended
  --> kernel/pmu_x86/src/lib.rs:51:5
   |
51 | //!     if let Ok(mut samples) = pmu_x86::retrieve_samples() {
   |     ^^^^ help: consider using four spaces per tab
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments

warning: using tabs in doc comments is not recommended
  --> kernel/pmu_x86/src/lib.rs:52:5
   |
52 | //!         pmu_x86::print_samples(&mut samples);
   |     ^^^^^^^^ help: consider using four spaces per tab
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments

warning: using tabs in doc comments is not recommended
  --> kernel/pmu_x86/src/lib.rs:53:5
   |
53 | //!     }
   |     ^^^^ help: consider using four spaces per tab
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments

warning: redundant field names in struct initialization
   --> kernel/ethernet_smoltcp_device/src/lib.rs:148:13
    |
148 |             nic_ref: nic_ref,
    |             ^^^^^^^^^^^^^^^^ help: replace it with: `nic_ref`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: `pmu_x86` (lib) generated 6 warnings (run `cargo clippy --fix --lib -p pmu_x86` to apply 1 suggestion)
warning: `ethernet_smoltcp_device` (lib) generated 1 warning (run `cargo clippy --fix --lib -p ethernet_smoltcp_device` to apply 1 suggestion)
warning: this returns a `Result<_, ()>`
  --> kernel/signal_handler/src/lib.rs:44:1
   |
44 | / pub fn register_signal_handler(
45 | |     signal: Signal,
46 | |     handler: Box<dyn SignalHandler>,
47 | | ) -> Result<(), ()> {
   | |___________________^
   |
   = help: use a custom `Error` type instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
   = note: `#[warn(clippy::result_unit_err)]` on by default

warning: constants have by default a `'static` lifetime
   --> kernel/debug_info/src/lib.rs:753:47
    |
753 | ...                   const DATARELRO: &'static str = ".data.rel.ro.";
    |                                        -^^^^^^^---- help: consider removing `'static`: `&str`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
    = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: redundant closure
   --> kernel/debug_info/src/lib.rs:254:34
    |
254 |                 .to_string().map(|s| String::from(s))?;
    |                                  ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `String::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> kernel/debug_info/src/lib.rs:293:17
    |
293 | /                 match eval_result {
294 | |                     gimli::EvaluationResult::Complete => {
295 | |                         let pieces = evaluation.result();
296 | |                         debug!("{:indent$}Completed evaluation: {:X?}", "", pieces, indent = ((depth+4) * 2));
297 | |                     }
298 | |                     _ => { }
299 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try this
    |
293 ~                 if let gimli::EvaluationResult::Complete = eval_result {
294 +                     let pieces = evaluation.result();
295 +                     debug!("{:indent$}Completed evaluation: {:X?}", "", pieces, indent = ((depth+4) * 2));
296 +                 }
    |

warning: redundant closure
   --> kernel/debug_info/src/lib.rs:407:44
    |
407 |                     s.to_string().ok().map(|s| String::from(s))
    |                                            ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `String::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/debug_info/src/lib.rs:412:44
    |
412 |                     s.to_string().ok().map(|s| String::from(s))
    |                                            ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `String::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant closure
   --> kernel/debug_info/src/lib.rs:811:22
    |
811 |                 .map(|arcref| DebugSectionSlice(arcref))
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `DebugSectionSlice`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: redundant field names in struct initialization
   --> kernel/slabmalloc/src/pages.rs:283:13
    |
283 |             heap_id: heap_id,
    |             ^^^^^^^^^^^^^^^^ help: replace it with: `heap_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: use `std::ptr::eq` when comparing raw pointers
   --> kernel/slabmalloc/src/pages.rs:518:16
    |
518 |             if slab_page as *const T == s as *const T {
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(slab_page, s)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
    = note: `#[warn(clippy::ptr_eq)]` on by default

warning: `signal_handler` (lib) generated 1 warning
warning: `debug_info` (lib) generated 6 warnings (run `cargo clippy --fix --lib -p debug_info` to apply 5 suggestions)
warning: `slabmalloc` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p slabmalloc` to apply 2 suggestions)
warning: use `std::ptr::eq` when comparing raw pointers
   --> kernel/slabmalloc_unsafe/src/pages.rs:432:16
    |
432 |             if slab_page as *const T == s as *const T {
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(slab_page, s)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
    = note: `#[warn(clippy::ptr_eq)]` on by default

warning: `slabmalloc_unsafe` (lib) generated 1 warning (run `cargo clippy --fix --lib -p slabmalloc_unsafe` to apply 1 suggestion)
warning: variables can be used directly in the `format!` string
  --> kernel/nano_core/build.rs:81:27
   |
81 |             custom_cfgs = format!("{}(\"{}\", \"{}\"), ", custom_cfgs, key, v);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
   |
81 -             custom_cfgs = format!("{}(\"{}\", \"{}\"), ", custom_cfgs, key, v);
81 +             custom_cfgs = format!("{custom_cfgs}(\"{key}\", \"{v}\"), ");
   |

warning: variables can be used directly in the `format!` string
  --> kernel/nano_core/build.rs:85:17
   |
85 |                 write!(custom_cfgs_str, "=\"{}\"", v).expect("Failed to write to custom_cfgs_str");
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
85 -                 write!(custom_cfgs_str, "=\"{}\"", v).expect("Failed to write to custom_cfgs_str");
85 +                 write!(custom_cfgs_str, "=\"{v}\"").expect("Failed to write to custom_cfgs_str");
   |

warning: variables can be used directly in the `format!` string
  --> kernel/nano_core/build.rs:94:5
   |
94 | /     write!(
95 | |         &mut built_file,
96 | |         "#[allow(dead_code)]\npub const CUSTOM_CFG: [(&str, &str); {}] = [{}];\n",
97 | |         num_custom_cfgs,
98 | |         custom_cfgs,
99 | |     ).unwrap();
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

warning: variables can be used directly in the `format!` string
   --> kernel/nano_core/build.rs:102:5
    |
102 | /     write!(
103 | |         &mut built_file,
104 | |         "#[allow(dead_code)]\npub const CUSTOM_CFG_STR: &str = r#\"{}\"#;\n",
105 | |         custom_cfgs_str,
106 | |     ).unwrap();
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

warning: variables can be used directly in the `format!` string
   --> kernel/nano_core/build.rs:119:13
    |
119 |             panic!("failed to create compiled_asm directory: {}", e);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
119 -             panic!("failed to create compiled_asm directory: {}", e);
119 +             panic!("failed to create compiled_asm directory: {e}");
    |

warning: variables can be used directly in the `format!` string
   --> kernel/nano_core/build.rs:156:33
    |
156 |             .unwrap_or_else(|_| panic!("couldn't get file type of {:?}", file))
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
156 -             .unwrap_or_else(|_| panic!("couldn't get file type of {:?}", file))
156 +             .unwrap_or_else(|_| panic!("couldn't get file type of {file:?}"))
    |

warning: redundant field names in struct initialization
   --> kernel/multiple_heaps/src/lib.rs:616:17
    |
616 |                 mp: mp
    |                 ^^^^^^ help: replace it with: `mp`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
    = note: `#[warn(clippy::redundant_field_names)]` on by default

warning: constants have by default a `'static` lifetime
  --> kernel/device_manager/src/lib.rs:44:26
   |
44 | const DEFAULT_LOCAL_IP: &'static str = "10.0.2.15/24"; // the default QEMU user-slirp network gives IP addresses of "10.0.2.*"
   |                         -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: `nano_core` (build script) generated 6 warnings
warning: `multiple_heaps` (lib) generated 1 warning (run `cargo clippy --fix --lib -p multiple_heaps` to apply 1 suggestion)
warning: `device_manager` (lib) generated 1 warning (run `cargo clippy --fix --lib -p device_manager` to apply 1 suggestion)
warning: constants have by default a `'static` lifetime
  --> kernel/first_application/src/lib.rs:30:38
   |
30 | const FIRST_APPLICATION_CRATE_NAME: &'static str = "shell-";
   |                                     -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: constants have by default a `'static` lifetime
  --> kernel/ota_update_client/src/lib.rs:65:28
   |
65 | const UPDATE_BUILDS_PATH: &'static str = "/updates.txt";
   |                           -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default

warning: constants have by default a `'static` lifetime
  --> kernel/ota_update_client/src/lib.rs:69:27
   |
69 | const LISTING_FILE_NAME: &'static str = "listing.txt";
   |                          -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
  --> kernel/ota_update_client/src/lib.rs:73:28
   |
73 | pub const DIFF_FILE_NAME: &'static str = "diff.txt";
   |                           -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
  --> kernel/ota_update_client/src/lib.rs:77:28
   |
77 | const CHECKSUMS_DIR_NAME: &'static str = "checksums";
   |                           -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: constants have by default a `'static` lifetime
  --> kernel/ota_update_client/src/lib.rs:80:33
   |
80 | const CHECKSUM_FILE_EXTENSION: &'static str = ".sha512";
   |                                -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

warning: variables can be used directly in the `format!` string
   --> kernel/ota_update_client/src/lib.rs:129:51
    |
129 |     download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, LISTING_FILE_NAME))
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
    |
129 -     download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, LISTING_FILE_NAME))
129 +     download_string_file(iface, remote_endpoint, &format!("/{update_build}/{LISTING_FILE_NAME}"))
    |

warning: variables can be used directly in the `format!` string
   --> kernel/ota_update_client/src/lib.rs:141:51
    |
141 |     download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, DIFF_FILE_NAME))
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
141 -     download_string_file(iface, remote_endpoint, &format!("/{}/{}", update_build, DIFF_FILE_NAME))
141 +     download_string_file(iface, remote_endpoint, &format!("/{update_build}/{DIFF_FILE_NAME}"))
    |

warning: redundant closure
   --> kernel/ota_update_client/src/lib.rs:162:40
    |
162 |         .map(|files| files.lines().map(|s| String::from(s)).collect())
    |                                        ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `String::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: variables can be used directly in the `format!` string
   --> kernel/ota_update_client/src/lib.rs:252:20
    |
252 |         let path = format!("/{}/{}", update_build, file_name);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
    |
252 -         let path = format!("/{}/{}", update_build, file_name);
252 +         let path = format!("/{update_build}/{file_name}");
    |

warning: `first_application` (lib) generated 1 warning (run `cargo clippy --fix --lib -p first_application` to apply 1 suggestion)
warning: `ota_update_client` (lib) generated 9 warnings (run `cargo clippy --fix --lib -p ota_update_client` to apply 9 suggestions)
   Compiling nano_core v0.1.0 (/home/amab/src/Theseus/kernel/nano_core)
    Finished dev [unoptimized + debuginfo] target(s) in 0.33s

amab8901 avatar Feb 10 '23 17:02 amab8901

ah, interesting. So some of the lints were configured as warnings while others were errors... seemingly the same lint just in different code bases (?).

I think we can open a new issue to track those since the actual clippy errors were already addressed. If you'd like to continue working on this, I'll let you lead that push (also I don't believe you'd be able to modify this issue anyway, so it's best to open a new one with editing privileges for you).

kevinaboos avatar Feb 10 '23 18:02 kevinaboos