about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacherr <jwc2002@outlook.com>2023-11-09 23:03:44 +0000
committerJacherr <jwc2002@outlook.com>2023-11-09 23:03:44 +0000
commiteabc64f56c4a907b942881b94815cbe2150e39db (patch)
tree296f08a9efe1b076e5e135676e24cbd527ac789f
parent7cdaa3b574a1c9dd94c1d0abc260f8a4d366cd98 (diff)
downloadrust-eabc64f56c4a907b942881b94815cbe2150e39db.tar.gz
rust-eabc64f56c4a907b942881b94815cbe2150e39db.zip
add additonal non-trigger testcase
-rw-r--r--tests/ui/vec_box_sized.rs3
-rw-r--r--tests/ui/vec_box_sized.stderr2
2 files changed, 4 insertions, 1 deletions
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<Box<i32, DummyAllocator>> {
         Vec::new()
     }
+    fn allocator_mismatch_2() -> Vec<Box<i32>, 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<Box<i32, DummyAllocator>, DummyAllocator> {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<i32>`
 
 error: `Vec<T>` 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<Box<S>> {
    |                       ^^^^^^^^^^^ help: try: `Vec<S>`