diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2025-03-31 12:56:49 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-31 12:56:49 +0000 |
| commit | b96fecfee984502c5ea1ca76ef871374efc0da85 (patch) | |
| tree | 0be57b5bab69022dfa5c654c5f3bef4a0714b168 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | bb0d09b220dc94fa956d59b395c825b217a8070e (diff) | |
| parent | f894a81654d6fd67137ba0676bfbd295a48cb471 (diff) | |
| download | rust-b96fecfee984502c5ea1ca76ef871374efc0da85.tar.gz rust-b96fecfee984502c5ea1ca76ef871374efc0da85.zip | |
Allow `#[expect]` and `#[allow]` within function bodies for `missing_panics_doc` (#14407)
Implements
https://github.com/rust-lang/rust-clippy/issues/11436#issuecomment-2719199421
> [...] I'd really like to be able to (reusing some above examples),
>
> ``` rust
> /// Do something
> pub fn string_from_byte_stream() -> String {
> let bytes = get_valid_utf8();
> #[expect(clippy::missing_panics_doc_ok, reason="caller can't do
anything about this")]
> String::from_utf8(bytes).expect("`get_valid_utf8()` always returns
valid UTF-8")
> }
> ```
Also fixes an issue where if the first panic is in a `const` context
disables the lint for the rest of the function
The first commit is just moving code around
changelog: [`missing_panics_doc`]: `#[allow]` and `#[expect]` can now be
used within the function body to ignore individual panics
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
