rust-lang / rust-lang/rust

Tracking issue for release notes of #149543: Reduce `unreachable-code` churn after `todo!()`

Open
#157,767 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-run-make A-rustdoc-json F-explicit_tail_calls release-blog-post relnotes relnotes-tracking-issue T-clippy T-compiler T-lang WG-trait-system-refactor
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

This issue tracks the release notes text for #149543.

cc @llogiq, @WaffleLapkin -- original issue/PR authors and assignees for drafting text

See the forge.rust-lang.org chapter about release notes for an overview of how the release team makes use of these tracking issues.

Release notes text

This section should be edited to specify the correct category(s) for the change, with succinct description(s) of what changed. Some things worth considering:

  • Does this need an additional compat notes section?
  • Was this a libs stabilization that should have additional headers to list new APIs under Stabilized APIs and Const Stabilized APIs?
# Language
- The `todo!()` macro will suppress the `unreachable_code` lint, so you no longer get a pile of warnings about unreachability for code in progress; instead, you'll get a single `todo_macro_calls` lint on the `todo!()` call itself. [Reduce `unreachable_code` churn after `todo!()`](https://github.com/rust-lang/rust/pull/149543)

[!TIP]
Use the previous releases for inspiration on how to write the release notes text and which categories to pick.

Release blog section

If this change is notable enough for inclusion in the blog post then this section should be edited to contain a draft for the blog post. Otherwise leave it empty.

## Better handling of `todo!()`

When you're working on code, you can use the `todo!()` macro (since Rust 1.40) to document that you haven't written a piece of code yet. This acts as a runtime panic if actually reached, but unlike `panic!()` or `unreachable!()`, it specifically documents that the code is in progress. You can then compile and test the rest of the code.

However, because `todo!()` is an unconditional panic, previous versions of Rust would warn that any code occurring after it is unreachable. This can produce a lot of noise about the code you're currently working on.

Now, the `todo!()` macro will suppress the `unreachable_code` lint, so you no longer get a pile of warnings about unreachability for code in progress. Instead, you'll get a single `todo_macro_calls` lint on the `todo!()` call itself. You can control these lints independently.

[!NOTE]

If a blog post section is required the release-blog-post label should be added (@rustbot label +release-blog-post) to this issue as otherwise it may be missed by the release team.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the Forge release-notes guidance and compare the proposed text with previous releases. Review the Release notes text and Release blog section in this issue, then adjust the category and wording as needed; leave the blog section empty unless the change is notable enough for the blog. Done means the release-note text is concise, correctly categorized, and any required blog-post label is added.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, release
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.