Rust 程序设计语言 简体中文版 1.85.0
`&String`, found `&{integer}` | | | arguments to this method are incorrect | = note: expected reference `&String` found reference `&{integer}` note: method 型默认是 i32。isize 或 usize 主要作为某些集合的索引。 整型溢出 比方说有一个 u8 ,它可以存放从零到 255 的值。那么当你将其修改为 256 时就会发 生 整型溢出(integer overflow ),这会导致以下两种行为之一的发生。当在 debug 44/562Rust 程序设计语言 简体中文版 模式编译时,Rust 检查这类问题并使程序 panic。panic 这个术语被 mismatched types --> src/main.rs:4:8 | 4 | if number { | ^^^^^^ expected `bool`, found integer For more information about this error, try `rustc --explain E0308`. error: could not compile `branches`0 码力 | 562 页 | 3.23 MB | 10 天前3
共 1 条
- 1