Skip to content

Commit dea0c4a

Browse files
authored
Suppress mismatched_lifetime_syntaxes lint in buildstructor crate demo (#303)
1 parent 2597319 commit dea0c4a

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ implicit_clone = "warn"
6969
implicit_saturating_sub = "warn"
7070
imprecise_flops = "warn"
7171
index_refutable_slice = "warn"
72+
indexing_slicing = "warn"
7273
invalid_upcast_comparisons = "warn"
7374
iter_not_returning_iterator = "warn"
7475
iter_on_empty_collections = "warn"
@@ -81,7 +82,6 @@ manual_instant_elapsed = "warn"
8182
manual_ok_or = "warn"
8283
many_single_char_names = "warn"
8384
map_flatten = "warn"
84-
match_on_vec_items = "warn"
8585
match_wild_err_arm = "warn"
8686
maybe_infinite_iter = "warn"
8787
mixed_read_write_in_expression = "warn"

bon-macros/src/util/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl<T> VecExt<T> for Vec<T> {
1010
fn try_retain_mut(&mut self, mut try_predicate: impl FnMut(&mut T) -> Result<bool>) -> Result {
1111
let mut i = 0;
1212
while i < self.len() {
13-
if try_predicate(&mut self[i])? {
13+
if try_predicate(self.get_mut(i).expect("BUG: index must be valid"))? {
1414
i += 1;
1515
} else {
1616
self.remove(i);

bon-sandbox/src/docs_comparison/methods.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub mod bon {
3131
/// Example docs generated with `buildstructor`
3232
// This lint comes from buildstructor-generated code
3333
#[expect(elided_lifetimes_in_paths)]
34+
// This lint comes from nightly
35+
#[allow(unknown_lints, mismatched_lifetime_syntaxes)]
3436
pub mod buildstructor {
3537

3638
/// Doc comment on `Struct`

bon/src/collections.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ macro_rules! arr {
7373

7474
#[cfg(test)]
7575
mod tests {
76+
// It's okay to use indexing in tests for conciseness.
77+
#![allow(clippy::indexing_slicing)]
78+
7679
#[cfg(feature = "alloc")]
7780
use crate::__::alloc::{string::String, vec::Vec};
7881
use core::num::NonZeroU8;

0 commit comments

Comments
 (0)