about summary refs log tree commit diff
path: root/compiler/rustc_error_messages
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-06-27 17:42:47 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-30 08:59:21 +0100
commit7a9bef4d83a091be25fdf0f1beaade66eec0cd92 (patch)
tree15fa22e0acc8b8a9f74438bbdec8a305fcd82ced /compiler/rustc_error_messages
parent7ef610c003f8072ec4ca4ecf195922a9a44e48dd (diff)
downloadrust-7a9bef4d83a091be25fdf0f1beaade66eec0cd92.tar.gz
rust-7a9bef4d83a091be25fdf0f1beaade66eec0cd92.zip
lint: port overflowing literals diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_error_messages')
-rw-r--r--compiler/rustc_error_messages/locales/en-US/lint.ftl25
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler/rustc_error_messages/locales/en-US/lint.ftl b/compiler/rustc_error_messages/locales/en-US/lint.ftl
index 621af76f695..ae53fb4821b 100644
--- a/compiler/rustc_error_messages/locales/en-US/lint.ftl
+++ b/compiler/rustc_error_messages/locales/en-US/lint.ftl
@@ -147,3 +147,28 @@ lint-drop-trait-constraints =
 
 lint-drop-glue =
     types that do not implement `Drop` can still have drop glue, consider instead using `{$needs_drop}` to detect whether a type is trivially dropped
+
+lint-range-endpoint-out-of-range = range endpoint is out of range for `{$ty}`
+    .suggestion = use an inclusive range instead
+
+lint-overflowing-bin-hex = literal out of range for `{$ty}`
+    .negative-note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}`
+    .negative-becomes-note = and the value `-{$lit}` will become `{$actually}{$ty}`
+    .positive-note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` and will become `{$actually}{$ty}`
+    .suggestion = consider using the type `{$suggestion_ty}` instead
+    .help = consider using the type `{$suggestion_ty}` instead
+
+lint-overflowing-int = literal out of range for `{$ty}`
+    .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}`
+    .help = consider using the type `{$suggestion_ty}` instead
+
+lint-only-cast-u8-to-char = only `u8` can be cast into `char`
+    .suggestion = use a `char` literal instead
+
+lint-overflowing-uint = literal out of range for `{$ty}`
+    .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}`
+
+lint-overflowing-literal = literal out of range for `{$ty}`
+    .note = the literal `{$lit}` does not fit into the type `{$ty}` and will be converted to `{$ty}::INFINITY`
+
+lint-unused-comparisons = comparison is useless due to type limits