about summary refs log tree commit diff
path: root/src/test/ui/enum
diff options
context:
space:
mode:
authorYI <uuuuuu@protonmail.com>2020-03-14 11:57:04 +0800
committerYI <uuuuuu@protonmail.com>2020-03-15 11:37:43 +0800
commita4ffbaadc81f9768a262059af77cf35fb88784bf (patch)
tree3ac524bc0c8fc6ab8f7860e09a60462aa48ba38d /src/test/ui/enum
parente5e8ba4edc435c9f87314b23a6c5d9c175bdf19c (diff)
downloadrust-a4ffbaadc81f9768a262059af77cf35fb88784bf.tar.gz
rust-a4ffbaadc81f9768a262059af77cf35fb88784bf.zip
Add more context to the literal overflow message
Diffstat (limited to 'src/test/ui/enum')
-rw-r--r--src/test/ui/enum/enum-discrim-too-small2.stderr7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/enum/enum-discrim-too-small2.stderr b/src/test/ui/enum/enum-discrim-too-small2.stderr
index 3aa88df29f1..fadf6ab86b4 100644
--- a/src/test/ui/enum/enum-discrim-too-small2.stderr
+++ b/src/test/ui/enum/enum-discrim-too-small2.stderr
@@ -9,24 +9,31 @@ note: the lint level is defined here
    |
 LL | #![deny(overflowing_literals)]
    |         ^^^^^^^^^^^^^^^^^^^^
+   = note: the literal `223` does not fit into the type `i8` whose range is `-128..=127`
 
 error: literal out of range for `i16`
   --> $DIR/enum-discrim-too-small2.rs:15:12
    |
 LL |     Ci16 = 55555,
    |            ^^^^^
+   |
+   = note: the literal `55555` does not fit into the type `i16` whose range is `-32768..=32767`
 
 error: literal out of range for `i32`
   --> $DIR/enum-discrim-too-small2.rs:22:12
    |
 LL |     Ci32 = 3_000_000_000,
    |            ^^^^^^^^^^^^^
+   |
+   = note: the literal `3_000_000_000` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
 
 error: literal out of range for `i64`
   --> $DIR/enum-discrim-too-small2.rs:29:12
    |
 LL |     Ci64 = 9223372036854775809,
    |            ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the literal `9223372036854775809` does not fit into the type `i64` whose range is `-9223372036854775808..=9223372036854775807`
 
 error: aborting due to 4 previous errors