diff --git a/clippy_lints/src/types/vec_box.rs b/clippy_lints/src/types/vec_box.rs index 6c329d8cdf1..02703ebecb9 100644 --- a/clippy_lints/src/types/vec_box.rs +++ b/clippy_lints/src/types/vec_box.rs @@ -42,7 +42,7 @@ pub(super) fn check( if !ty_ty.has_escaping_bound_vars(); if ty_ty.is_sized(cx.tcx.at(ty.span), cx.param_env); if let Ok(ty_ty_size) = cx.layout_of(ty_ty).map(|l| l.size.bytes()); - if ty_ty_size <= box_size_threshold; + if ty_ty_size < box_size_threshold; then { span_lint_and_sugg( cx, diff --git a/tests/ui-toml/vec_box_sized/test.rs b/tests/ui-toml/vec_box_sized/test.rs index bf04bee1637..4c46deb585b 100644 --- a/tests/ui-toml/vec_box_sized/test.rs +++ b/tests/ui-toml/vec_box_sized/test.rs @@ -7,8 +7,9 @@ struct C { } struct Foo(Vec>); -struct Bar(Vec>); -struct Baz(Vec>); +struct Bar(Vec>); +struct Quux(Vec>); +struct Baz(Vec>); struct BarBaz(Vec>); struct FooBarBaz(Vec>); diff --git a/tests/ui-toml/vec_box_sized/test.stderr b/tests/ui-toml/vec_box_sized/test.stderr index cf194de3c55..55de68f8ecf 100644 --- a/tests/ui-toml/vec_box_sized/test.stderr +++ b/tests/ui-toml/vec_box_sized/test.stderr @@ -9,11 +9,11 @@ LL | struct Foo(Vec>); error: `Vec` is already on the heap, the boxing is unnecessary --> $DIR/test.rs:10:12 | -LL | struct Bar(Vec>); - | ^^^^^^^^^^^^^ help: try: `Vec` +LL | struct Bar(Vec>); + | ^^^^^^^^^^^^^ help: try: `Vec` error: `Vec` is already on the heap, the boxing is unnecessary - --> $DIR/test.rs:13:18 + --> $DIR/test.rs:14:18 | LL | struct FooBarBaz(Vec>); | ^^^^^^^^^^^ help: try: `Vec`