Skip to content

Update lint-docs to default to Rust 2024 #140348

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Apr 27, 2025
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Apr 26, 2025

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 #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.

ehuss added 2 commits April 26, 2025 14:08
This removes the hard-coded list of edition support in the lint-docs
tool, and instead just assumes the edition attribute is something valid.
There isn't a real reason to have this, as rustc will error if given a
wrong number. This should be easier to maintain going forward.
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
rust-lang#133349.

Some docs needed to add the `edition` attribute since they were assuming
a particular edition, but were missing the explicit annotation.
@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 26, 2025
@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 27, 2025

📌 Commit 1f108fe has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 27, 2025
tgross35 added a commit to tgross35/rust that referenced this pull request Apr 27, 2025
…r-errors

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 rust-lang#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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#137439 (Stabilise `std::ffi::c_str`)
 - rust-lang#139031 (Use char::is_whitespace directly in str::trim*)
 - rust-lang#139090 (fix docs for `Peekable::next_if{_eq}`)
 - rust-lang#140220 (Fix detection of main function if there are expressions around it)
 - rust-lang#140297 (Update example to use CStr::to_string_lossy)
 - rust-lang#140330 (Clarified bootstrap optimization "true" argument)
 - rust-lang#140339 (session: Cleanup `CanonicalizedPath::new`)
 - rust-lang#140348 (Update lint-docs to default to Rust 2024)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2025
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#140246 (Fix never pattern printing)
 - rust-lang#140280 (Improve if/else pretty printing)
 - rust-lang#140348 (Update lint-docs to default to Rust 2024)
 - rust-lang#140358 (Use `search_for_cycle_permutation` to look for `variances_of`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c006eb7 into rust-lang:master Apr 27, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 27, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2025
Rollup merge of rust-lang#140348 - ehuss:lint-docs-edition, r=compiler-errors

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 rust-lang#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.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants