File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ except in cases where C has undefined behavior. The behavior of all casts
88between integral types is well defined in Rust.
99
1010``` rust,editable,ignore,mdbook-runnable
11- // Suppress all warnings from casts which overflow.
11+ // Suppress all errors from casts which overflow.
1212#![allow(overflowing_literals)]
1313
1414fn main() {
@@ -31,7 +31,8 @@ fn main() {
3131
3232 // when casting any value to an unsigned type, T,
3333 // T::MAX + 1 is added or subtracted until the value
34- // fits into the new type
34+ // fits into the new type ONLY when the #![allow(overflowing_literals)]
35+ // lint is specified like above. Otherwise there will be a compiler error.
3536
3637 // 1000 already fits in a u16
3738 println!("1000 as a u16 is: {}", 1000 as u16);
You can’t perform that action at this time.
0 commit comments