{integer}
in error messages is a placeholder for any of the integer types ({i,u}{8,16,32,64,128}
). (Source)
Integer literals in Rust are type inferred based on their usage. For example, in the following code, the type of 123
is u8
in the first instance and u64
in the second:
let a: u8 = 123;
let a: u64 = 123;
{integer}
is used to represent any integer type in error messages when the compiler hasn't figured out a concrete type of the value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…