Tracking issue for release notes of #149543: Reduce `unreachable-code` churn after `todo!()`
Nobody has claimed this yet.
- 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 APIsandConst 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-postlabel should be added (@rustbot label +release-blog-post) to this issue as otherwise it may be missed by the release team.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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