docs: explain match assertions and annotation type distinctions

This commit is contained in:
2026-11-15 19:14:55 +08:00
parent 903b3bbf9d
commit 57cd32eb5c
16 changed files with 58 additions and 6 deletions
+1
View File
@@ -190,6 +190,7 @@ fn arithmetic_precedence_and_left_associativity_form_the_expected_tree() {
let ExprKind::Unary { operand, .. } = nested.kind else {
panic!("expected outer negate");
};
// 外层负号的操作数仍是 Negate,证明解析器保留两个前缀节点而未提前计算数值。
assert!(matches!(
operand.kind,
ExprKind::Unary {