We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3256791 + ae88a08 commit 8c7d8b1Copy full SHA for 8c7d8b1
1 file changed
src/types/cast.md
@@ -8,7 +8,7 @@ except in cases where C has undefined behavior. The behavior of all casts
8
between integral types is well defined in Rust.
9
10
```rust,editable,ignore,mdbook-runnable
11
-// Suppress all warnings from casts which overflow.
+// Suppress all errors from casts which overflow.
12
#![allow(overflowing_literals)]
13
14
fn main() {
@@ -31,7 +31,8 @@ fn main() {
31
32
// when casting any value to an unsigned type, T,
33
// T::MAX + 1 is added or subtracted until the value
34
- // fits into the new type
+ // fits into the new type ONLY when the #![allow(overflowing_literals)]
35
+ // lint is specified like above. Otherwise there will be a compiler error.
36
37
// 1000 already fits in a u16
38
println!("1000 as a u16 is: {}", 1000 as u16);
0 commit comments