Skip to content

Commit

Permalink
Rollup merge of #114070 - blyxyas:iter_mut_symbol, r=oli-obk
Browse files Browse the repository at this point in the history
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 rust-lang/rust-clippy#11038 and another Clippy lint, it also adds `sym::as_mut_ptr` as it's useful for rust-lang/rust-clippy#10962.
  • Loading branch information
matthiaskrgr committed Jul 26, 2023
2 parents 998fd94 + 654b924 commit c6bfa77
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ symbols! {
arm_target_feature,
array,
arrays,
as_mut_ptr,
as_ptr,
as_ref,
as_str,
Expand Down Expand Up @@ -858,6 +859,7 @@ symbols! {
item,
item_like_imports,
iter,
iter_mut,
iter_repeat,
iterator_collect_fn,
kcfi,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/methods/bytecount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/meta-macro-hygiene.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/nonterminal-token-hygiene.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;

Expand Down

0 comments on commit c6bfa77

Please sign in to comment.