This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
compiler/rustc_builtin_macros/src Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ pub fn expand_concat_bytes(
154154 }
155155 }
156156 } else {
157- cx. span_err ( count. value . span , "repeat count is not a number" ) ;
157+ cx. span_err ( count. value . span , "repeat count is not a positive number" ) ;
158158 }
159159 }
160160 ast:: ExprKind :: Lit ( ref lit) => match lit. kind {
Original file line number Diff line number Diff line change @@ -39,12 +39,12 @@ fn main() {
3939 ] ) ;
4040 concat_bytes ! ( 5u16 ) ; //~ ERROR cannot concatenate numeric literals
4141 concat_bytes ! ( [ 5u16 ] ) ; //~ ERROR numeric literal is not a `u8`
42- concat_bytes ! ( [ 3 ; ( ) ] ) ; //~ ERROR repeat count is not a number
43- concat_bytes ! ( [ 3 ; -2 ] ) ; //~ ERROR repeat count is not a number
44- concat_bytes ! ( [ pie; -2 ] ) ; //~ ERROR repeat count is not a number
42+ concat_bytes ! ( [ 3 ; ( ) ] ) ; //~ ERROR repeat count is not a positive number
43+ concat_bytes ! ( [ 3 ; -2 ] ) ; //~ ERROR repeat count is not a positive number
44+ concat_bytes ! ( [ pie; -2 ] ) ; //~ ERROR repeat count is not a positive number
4545 concat_bytes ! ( [ pie; 2 ] ) ; //~ ERROR expected a byte literal
4646 concat_bytes ! ( [ 2.2 ; 0 ] ) ; //~ ERROR cannot concatenate float literals
47- concat_bytes ! ( [ 5.5 ; ( ) ] ) ; //~ ERROR repeat count is not a number
47+ concat_bytes ! ( [ 5.5 ; ( ) ] ) ; //~ ERROR repeat count is not a positive number
4848 concat_bytes ! ( [ [ 1 , 2 , 3 ] ; 3 ] ) ; //~ ERROR cannot concatenate doubly nested array
4949 concat_bytes ! ( [ [ 42 ; 2 ] ; 3 ] ) ; //~ ERROR cannot concatenate doubly nested array
5050}
Original file line number Diff line number Diff line change @@ -127,19 +127,19 @@ error: numeric literal is not a `u8`
127127LL | concat_bytes!([5u16]);
128128 | ^^^^
129129
130- error: repeat count is not a number
130+ error: repeat count is not a positive number
131131 --> $DIR/concat-bytes-error.rs:42:23
132132 |
133133LL | concat_bytes!([3; ()]);
134134 | ^^
135135
136- error: repeat count is not a number
136+ error: repeat count is not a positive number
137137 --> $DIR/concat-bytes-error.rs:43:23
138138 |
139139LL | concat_bytes!([3; -2]);
140140 | ^^
141141
142- error: repeat count is not a number
142+ error: repeat count is not a positive number
143143 --> $DIR/concat-bytes-error.rs:44:25
144144 |
145145LL | concat_bytes!([pie; -2]);
@@ -159,7 +159,7 @@ error: cannot concatenate float literals
159159LL | concat_bytes!([2.2; 0]);
160160 | ^^^
161161
162- error: repeat count is not a number
162+ error: repeat count is not a positive number
163163 --> $DIR/concat-bytes-error.rs:47:25
164164 |
165165LL | concat_bytes!([5.5; ()]);
You can’t perform that action at this time.
0 commit comments