|
|
|
@ -76,13 +76,14 @@
|
|
|
|
|
## B
|
|
|
|
|
|
|
|
|
|
| 名称 | 关键字 | 简介 |
|
|
|
|
|
| ------------ | --------- | ------------------------------------------------------------------------------ |
|
|
|
|
|
| ------------------ | ------------ | ------------------------------------------------------------------------------ |
|
|
|
|
|
| [变量遮蔽] | shadowing | 允许声明相同的变量名,后者会遮蔽掉前者 |
|
|
|
|
|
| [变量覆盖] | 模式匹配 | 无论是是 `match` 还是 `if let`,他们都可以在模式匹配时覆盖掉老的值,绑定新的值 |
|
|
|
|
|
| [变量作用域] | 所有权 | 作用域是一个变量在程序中有效的范围 |
|
|
|
|
|
| [表达式] | | 进行求值,结尾无 `;`,有返回值 |
|
|
|
|
|
| [bool 布尔] | 布尔类型 | `true` `false`,占用 1 字节 |
|
|
|
|
|
| [break] | 循环控制 | 直接跳出当前整个循环 |
|
|
|
|
|
| [backtrace 栈展开] | 不可恢复错误 | `RUST_BACKTRACE=1 cargo run` |
|
|
|
|
|
| | KWB | |
|
|
|
|
|
|
|
|
|
|
[变量遮蔽]: https://course.rs/basic/variable.html#变量遮蔽shadowing
|
|
|
|
@ -91,6 +92,7 @@
|
|
|
|
|
[bool 布尔]: https://course.rs/basic/base-type/char-bool.html#布尔bool
|
|
|
|
|
[表达式]: https://course.rs/basic/base-type/statement-expression.html#表达式
|
|
|
|
|
[break]: https://course.rs/basic/flow-control.html#break
|
|
|
|
|
[backtrace 栈展开]: https://course.rs/basic/result-error/panic.html#backtrace-栈展开
|
|
|
|
|
|
|
|
|
|
[back](#head)
|
|
|
|
|
|
|
|
|
@ -295,9 +297,14 @@
|
|
|
|
|
## P
|
|
|
|
|
|
|
|
|
|
| 名称 | 关键字 | 简介 |
|
|
|
|
|
| ---- | ------ | ---- |
|
|
|
|
|
| --------------------- | ------------ | -------------------------------------------------------------------- |
|
|
|
|
|
| [panic! 不可恢复错误] | 不可恢复错误 | 程序会打印出一个错误信息,展开报错点往前的函数调用堆栈,最后退出程序 |
|
|
|
|
|
| [panic 原理剖析] | 不可恢复错误 | |
|
|
|
|
|
| | KWP | |
|
|
|
|
|
|
|
|
|
|
[panic! 不可恢复错误]: https://course.rs/basic/result-error/panic.html#panic-与不可恢复错误
|
|
|
|
|
[panic 原理剖析]: https://course.rs/basic/result-error/panic.html#panic-原理剖析
|
|
|
|
|
|
|
|
|
|
[back](#head)
|
|
|
|
|
|
|
|
|
|
## Q
|
|
|
|
|