Skip to content

Commit a2ab68b

Browse files
committed
Requirements for the bits-attribute-wrong message
1 parent 9d1d59c commit a2ab68b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

bitfield/tests/11-bits-attribute-wrong.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// This is just the compile_fail version of the previous test case, testing what
22
// error happens if the user has written an incorrect #[bits = N] attribute.
3+
//
4+
// Ensure that the error message points to the incorrect attribute and contains
5+
// the correct number of bits in some form.
36

47
use bitfield::*;
58

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0308]: mismatched types
2-
--> $DIR/11-bits-attribute-wrong.rs:8:14
3-
|
4-
8 | #[bits = 9]
5-
| ^ expected an array with a fixed size of 9 elements, found one with 1 elements
6-
|
7-
= note: expected type `[(); 9]`
8-
found type `[(); 1]`
2+
--> $DIR/11-bits-attribute-wrong.rs:11:14
3+
|
4+
11 | #[bits = 9]
5+
| ^ expected an array with a fixed size of 9 elements, found one with 1 elements
6+
|
7+
= note: expected type `[(); 9]`
8+
found type `[(); 1]`
99

1010
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)