From eabc64f56c4a907b942881b94815cbe2150e39db Mon Sep 17 00:00:00 2001 From: Jacherr Date: Thu, 9 Nov 2023 23:03:44 +0000 Subject: [PATCH] add additonal non-trigger testcase --- tests/ui/vec_box_sized.rs | 3 +++ tests/ui/vec_box_sized.stderr | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ui/vec_box_sized.rs b/tests/ui/vec_box_sized.rs index e46f5bf2126..49eaf8e062a 100644 --- a/tests/ui/vec_box_sized.rs +++ b/tests/ui/vec_box_sized.rs @@ -63,6 +63,9 @@ mod should_not_trigger { fn allocator_mismatch() -> Vec> { Vec::new() } + fn allocator_mismatch_2() -> Vec, DummyAllocator> { + Vec::new_in(DummyAllocator) + } } mod inner_mod { diff --git a/tests/ui/vec_box_sized.stderr b/tests/ui/vec_box_sized.stderr index db5674210d9..d6479271fa6 100644 --- a/tests/ui/vec_box_sized.stderr +++ b/tests/ui/vec_box_sized.stderr @@ -50,7 +50,7 @@ LL | fn allocator_match() -> Vec, DummyAllocator> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec` error: `Vec` is already on the heap, the boxing is unnecessary - --> $DIR/vec_box_sized.rs:76:23 + --> $DIR/vec_box_sized.rs:79:23 | LL | pub fn f() -> Vec> { | ^^^^^^^^^^^ help: try: `Vec`