Skip to content

Conversation

@RPG-Alex
Copy link
Contributor

Tighten linting; fix rustdoc warnings across feature gates

I continued using stricter linting and found several odd cases in tests and
examples, along with rustdoc warnings triggered by feature-gated items.

This commit cleans up those warnings by:

  • adjusting tests to avoid clippy false positives under -D warnings
  • removing unused generics and ambiguous empty vec initializers
  • fixing rustdoc links via feature-gated doc attributes rather than
    linking to non-exported items

All tests are still passing.

Clippy still warns about the use of 1..-1 as an empty range; this appears
intentional in ndarray slicing semantics, so I’ve left it unchanged for now.

Please review the rustdoc changes that rely on feature-gated documentation.

@akern40
Copy link
Collaborator

akern40 commented Jan 18, 2026

@RPG-Alex same question as before, is this just another round of cargo clips --all-features --all-targets -- -D warnings? Or something else? I do think I'll want to add these to CI

@RPG-Alex
Copy link
Contributor Author

@RPG-Alex same question as before, is this just another round of cargo clips --all-features --all-targets -- -D warnings? Or something else? I do think I'll want to add these to CI

If you want to add it to the CI then be aware that the strictest setting is still sending errors:

error: this range is empty so it will yield no values
   --> benches/bench1.rs:746:35
    |
746 |     let a = a.slice_mut(s![1..-1, 1..-1]);
    |                                   ^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
help: consider using the following if you are attempting to iterate over this range in reverse
    |
746 -     let a = a.slice_mut(s![1..-1, 1..-1]);
746 +     let a = a.slice_mut(s![1..-1, (-1..1).rev()]);

This one is odd and I was considering opening an isuse about these tests as 1..-1 is an empty set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants