Update lint-docs to default to Rust 2024
This updates the lint-docs tool to default to the 2024 edition. The lint docs are supposed to illustrate the code with the latest edition, and I just forgot to update this in https://github.com/rust-lang/rust/pull/133349.
Some docs needed to add the `edition` attribute since they were assuming a particular edition, but were missing the explicit annotation.
This also includes a commit to simplify the edition handling in lint-docs.