diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-26 20:49:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-26 20:49:13 +0200 |
| commit | c6bfa7761ab19286e7d5a32b00c7fc0601cb3e47 (patch) | |
| tree | 749e44da4472b37a8118aa431765876a3ddb5d82 | |
| parent | 998fd94405d5d48f9d096fb80b6d42862805f314 (diff) | |
| parent | 654b9243407df9079e5877b445e669c35cea5b63 (diff) | |
| download | rust-c6bfa7761ab19286e7d5a32b00c7fc0601cb3e47.tar.gz rust-c6bfa7761ab19286e7d5a32b00c7fc0601cb3e47.zip | |
Rollup merge of #114070 - blyxyas:iter_mut_symbol, r=oli-obk
Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy We currently have `sym::iter` and `sym::iter_repeat`, this PR adds `sym::iter_mut` as it's useful for https://github.com/rust-lang/rust-clippy/pull/11038 and another Clippy lint, it also adds `sym::as_mut_ptr` as it's useful for https://github.com/rust-lang/rust-clippy/pull/10962.
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 2 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/methods/bytecount.rs | 2 | ||||
| -rw-r--r-- | tests/ui/proc-macro/meta-macro-hygiene.stdout | 2 | ||||
| -rw-r--r-- | tests/ui/proc-macro/nonterminal-token-hygiene.stdout | 2 |
4 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 08925761b39..54eb7bef5f2 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -372,6 +372,7 @@ symbols! { arm_target_feature, array, arrays, + as_mut_ptr, as_ptr, as_ref, as_str, @@ -858,6 +859,7 @@ symbols! { item, item_like_imports, iter, + iter_mut, iter_repeat, iterator_collect_fn, kcfi, diff --git a/src/tools/clippy/clippy_lints/src/methods/bytecount.rs b/src/tools/clippy/clippy_lints/src/methods/bytecount.rs index fef90f6eba4..f490a717554 100644 --- a/src/tools/clippy/clippy_lints/src/methods/bytecount.rs +++ b/src/tools/clippy/clippy_lints/src/methods/bytecount.rs @@ -45,7 +45,7 @@ pub(super) fn check<'tcx>( let haystack = if let ExprKind::MethodCall(path, receiver, [], _) = filter_recv.kind { let p = path.ident.name; - if p == sym::iter || p == sym!(iter_mut) { + if p == sym::iter || p == sym::iter_mut { receiver } else { filter_recv diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 17b69daa4f0..4a2200091b2 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -18,7 +18,7 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#1 */; -extern crate compiler_builtins /* 442 */ as _ /* 0#1 */; +extern crate compiler_builtins /* 443 */ as _ /* 0#1 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index 76d54ab2f13..077a728a7a6 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -39,7 +39,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; #[macro_use /* 0#1 */] extern crate core /* 0#2 */; -extern crate compiler_builtins /* 442 */ as _ /* 0#2 */; +extern crate compiler_builtins /* 443 */ as _ /* 0#2 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; |
