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.
This commit is contained in:
Matthias Krüger 2023-07-26 20:49:13 +02:00 committed by GitHub
commit c6bfa7761a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -372,6 +372,7 @@
arm_target_feature, arm_target_feature,
array, array,
arrays, arrays,
as_mut_ptr,
as_ptr, as_ptr,
as_ref, as_ref,
as_str, as_str,
@ -858,6 +859,7 @@
item, item,
item_like_imports, item_like_imports,
iter, iter,
iter_mut,
iter_repeat, iter_repeat,
iterator_collect_fn, iterator_collect_fn,
kcfi, kcfi,

View File

@ -45,7 +45,7 @@ pub(super) fn check<'tcx>(
let haystack = if let ExprKind::MethodCall(path, receiver, [], _) = let haystack = if let ExprKind::MethodCall(path, receiver, [], _) =
filter_recv.kind { filter_recv.kind {
let p = path.ident.name; let p = path.ident.name;
if p == sym::iter || p == sym!(iter_mut) { if p == sym::iter || p == sym::iter_mut {
receiver receiver
} else { } else {
filter_recv filter_recv

View File

@ -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 */::*; use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*;
#[macro_use /* 0#1 */] #[macro_use /* 0#1 */]
extern crate core /* 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 // Don't load unnecessary hygiene information from std
extern crate std /* 0#0 */; extern crate std /* 0#0 */;

View File

@ -39,7 +39,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*;
#[macro_use /* 0#1 */] #[macro_use /* 0#1 */]
extern crate core /* 0#2 */; 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 // Don't load unnecessary hygiene information from std
extern crate std /* 0#0 */; extern crate std /* 0#0 */;