diff options
| author | bors <bors@rust-lang.org> | 2023-04-25 13:02:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-25 13:02:52 +0000 |
| commit | abd2c1e8e43f16249a6eebd0e666461ee11d89fa (patch) | |
| tree | 62699f9b8b0ae27937cd83d3748112b15c74db86 /tests/rustdoc-js-std/parser-slice-array.js | |
| parent | c4f2c48d9bed4146b1b317e17854f1cefcaf0f42 (diff) | |
| parent | 14a6fa4a34d24ec81fe562b71966471efcbb32b2 (diff) | |
| download | rust-abd2c1e8e43f16249a6eebd0e666461ee11d89fa.tar.gz rust-abd2c1e8e43f16249a6eebd0e666461ee11d89fa.zip | |
Auto merge of #10665 - Centri3:string_lit_as_bytes_changes, r=giraffate
Don't apply `string_lit_as_bytes` if in macro expansion
The following code will emit a warning on both w! and h!, despite there being nothing the user (or library author) could do about it:
```rust
#![warn(clippy::string_lit_as_bytes)]
use windows::w;
use windows::h;
fn main() {
let _w = w!("example");
let _h = h!("example");
}
```
This is because windows-rs will create a binding `const INPUT: &[u8] = $s.as_bytes()`, and changing this to b"$s" is, well, suboptimal. I don't know enough about Rust to know if this is something that can be detected though if it can be I'm happy with closing this in favor of implementing that.
I'm not sure whether this is how it should be done though, as this simply tells clippy to not invoke this even if it's applicable (this also affects the other string lints, but didn't cause any tests to fail).
changelog: [`string_lit_as_bytes`]: Don't lint if in external macro
Diffstat (limited to 'tests/rustdoc-js-std/parser-slice-array.js')
0 files changed, 0 insertions, 0 deletions
