Literals and operators - Wording - need to tell the compiler the type #1874
Open
Description
Please review below for any doc changes needed
At https://doc.rust-lang.org/rust-by-example/primitives/literals.html
It says We need to tell the compiler the type of the literals we use.
I felt that is must
or have to
( though it dint say so ), otherwise may tell
or could tell
can be used
However, it works without telling the type
There is no need to tell, it can infer.
So doc should be changed?
==
// Integer addition
println!("1 + 2 = {}", 1 + 2); // =============== i wrote this
println!("1 + 2 = {}", 1u32 + 2);
1 + 2 = 3 // =============== i wrote this
1 + 2 = 3
==
Activity