summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/vec_box_sized
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui-toml/vec_box_sized')
-rw-r--r--src/tools/clippy/tests/ui-toml/vec_box_sized/test.fixed16
-rw-r--r--src/tools/clippy/tests/ui-toml/vec_box_sized/test.stderr1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui-toml/vec_box_sized/test.fixed b/src/tools/clippy/tests/ui-toml/vec_box_sized/test.fixed
new file mode 100644
index 000000000..bb4936401
--- /dev/null
+++ b/src/tools/clippy/tests/ui-toml/vec_box_sized/test.fixed
@@ -0,0 +1,16 @@
+struct S {
+ x: u64,
+}
+
+struct C {
+ y: u16,
+}
+
+struct Foo(Vec<u8>);
+struct Bar(Vec<u16>);
+struct Quux(Vec<Box<u32>>);
+struct Baz(Vec<Box<(u16, u16)>>);
+struct BarBaz(Vec<Box<S>>);
+struct FooBarBaz(Vec<C>);
+
+fn main() {}
diff --git a/src/tools/clippy/tests/ui-toml/vec_box_sized/test.stderr b/src/tools/clippy/tests/ui-toml/vec_box_sized/test.stderr
index 55de68f8e..c88860ea8 100644
--- a/src/tools/clippy/tests/ui-toml/vec_box_sized/test.stderr
+++ b/src/tools/clippy/tests/ui-toml/vec_box_sized/test.stderr
@@ -5,6 +5,7 @@ LL | struct Foo(Vec<Box<u8>>);
| ^^^^^^^^^^^^ help: try: `Vec<u8>`
|
= note: `-D clippy::vec-box` implied by `-D warnings`
+ = help: to override `-D warnings` add `#[allow(clippy::vec_box)]`
error: `Vec<T>` is already on the heap, the boxing is unnecessary
--> $DIR/test.rs:10:12