Skip to content

Commit eabc64f

Browse files
committed
add additonal non-trigger testcase
1 parent 7cdaa3b commit eabc64f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/ui/vec_box_sized.rs

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ mod should_not_trigger {
6363
fn allocator_mismatch() -> Vec<Box<i32, DummyAllocator>> {
6464
Vec::new()
6565
}
66+
fn allocator_mismatch_2() -> Vec<Box<i32>, DummyAllocator> {
67+
Vec::new_in(DummyAllocator)
68+
}
6669
}
6770

6871
mod inner_mod {

tests/ui/vec_box_sized.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ LL | fn allocator_match() -> Vec<Box<i32, DummyAllocator>, DummyAllocator> {
5050
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Vec<i32>`
5151

5252
error: `Vec<T>` is already on the heap, the boxing is unnecessary
53-
--> $DIR/vec_box_sized.rs:76:23
53+
--> $DIR/vec_box_sized.rs:79:23
5454
|
5555
LL | pub fn f() -> Vec<Box<S>> {
5656
| ^^^^^^^^^^^ help: try: `Vec<S>`

0 commit comments

Comments
 (0)