File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ See [literal expressions] for the effect of these suffixes.
366
366
Examples of integer literals of various forms:
367
367
368
368
``` rust
369
+ # #![allow(overflowing_literals)]
369
370
123 ;
370
371
123i32 ;
371
372
123u32 ;
@@ -382,6 +383,12 @@ Examples of integer literals of various forms:
382
383
0b________1 ;
383
384
384
385
0usize ;
386
+
387
+ // These are too big for their type, but are still valid tokens
388
+
389
+ 128_i8 ;
390
+ 256_u8 ;
391
+
385
392
```
386
393
387
394
Note that ` -1i8 ` , for example, is analyzed as two tokens: ` - ` followed by ` 1i8 ` .
@@ -399,11 +406,6 @@ Examples of invalid integer literals:
399
406
0b0102;
400
407
0o0581;
401
408
402
- // integers too big for their type (they overflow)
403
-
404
- 128_i8;
405
- 256_u8;
406
-
407
409
// bin, hex, and octal literals must have at least one digit
408
410
409
411
0b_;
You can’t perform that action at this time.
0 commit comments