)]}'
{
  "commit": "4fd8e8151aace293c28d063f67d2b51e58851fc8",
  "tree": "db59158ec5d38c8479395839bfd8de511d46cdae",
  "parents": [
    "86635e30bf861a038dc197d7e16fd09e7e514e7a"
  ],
  "author": {
    "name": "Travis Cross",
    "email": "tc@traviscross.com",
    "time": "Wed Jul 01 19:48:56 2026 +0000"
  },
  "committer": {
    "name": "Travis Cross",
    "email": "tc@traviscross.com",
    "time": "Thu Jul 02 05:16:17 2026 +0000"
  },
  "message": "Fix the tagged-union pattern-matching recommendation\n\nThe union chapter recommends matching a tag and its corresponding\nunion field together in a single pattern when implementing a C-style\ntagged union.  This suggests the idiom is safe.\n\nBut it\u0027s not.  We don\u0027t guarantee the order that subpatterns are\nchecked -- this could only be safe if we could be sure the tag is\nchecked first.  And, in fact, if an or-pattern is used when matching\nthe tag, then `rustc` defers the check, causing actual UB (see\nrust-lang/rust#158387).\n\nLet\u0027s fix that.  We can remove the `items.union.pattern.subpattern`\nrule entirely -- it\u0027s trivially true that a pattern can appear\nas a subpattern.  In its place, let\u0027s add a warning admonition\nthat highlights what isn\u0027t guaranteed and describes what people\nshould do instead.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c330b037007ff36dc2e8475daefc96e176121914",
      "old_mode": 33188,
      "old_path": "src/items/unions.md",
      "new_id": "e1f183f306d2a195cf1ad21cc9f30a9ec712edcd",
      "new_mode": 33188,
      "new_path": "src/items/unions.md"
    }
  ]
}
