Skip to content

Commit 4879078

Browse files
committed
Allow none Sized types in assert_eq!
format_args! doesn't support none Sized types so we should just pass it the references to left_val and right_val. This fixes `assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])` for example.
1 parent 8fbd292 commit 4879078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ macro_rules! assert_eq {
8989
(left_val, right_val) => {
9090
if !(*left_val == *right_val) {
9191
panic!("assertion failed: `(left == right)` \
92-
(left: `{:?}`, right: `{:?}`)", *left_val, *right_val)
92+
(left: `{:?}`, right: `{:?}`)", left_val, right_val)
9393
}
9494
}
9595
}

0 commit comments

Comments
 (0)