Skip to content

Commit f2f0175

Browse files
committed
Auto merge of rust-lang#13543 - GnomedDev:symbol-comparisons, r=y21
Add internal lint to check for slow symbol comparisons See the conversation on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Checking.20a.20Symbol.20is.20equal.20to.20a.20string.20literal). changelog: none
2 parents 6a79588 + 979e297 commit f2f0175

36 files changed

+200
-63
lines changed

book/src/development/common_tools_writing_lints.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> LateLintPass<'tcx> for MyStructLint {
6868
// Check our expr is calling a method
6969
if let hir::ExprKind::MethodCall(path, _, _self_arg, ..) = &expr.kind
7070
// Check the name of this method is `some_method`
71-
&& path.ident.name == sym!(some_method)
71+
&& path.ident.name.as_str() == "some_method"
7272
// Optionally, check the type of the self argument.
7373
// - See "Checking for a specific type"
7474
{
@@ -167,7 +167,7 @@ impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
167167
// Check if item is a method/function
168168
if let ImplItemKind::Fn(ref signature, _) = impl_item.kind
169169
// Check the method is named `some_method`
170-
&& impl_item.ident.name == sym!(some_method)
170+
&& impl_item.ident.name.as_str() == "some_method"
171171
// We can also check it has a parameter `self`
172172
&& signature.decl.implicit_self.has_implicit_self()
173173
// We can go further and even check if its return type is `String`

book/src/development/method_checking.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
In some scenarios we might want to check for methods when developing
44
a lint. There are two kinds of questions that we might be curious about:
55

6-
- Invocation: Does an expression call a specific method?
7-
- Definition: Does an `impl` define a method?
6+
- Invocation: Does an expression call a specific method?
7+
- Definition: Does an `impl` define a method?
88

99
## Checking if an `expr` is calling a specific method
1010

@@ -23,7 +23,7 @@ impl<'tcx> LateLintPass<'tcx> for OurFancyMethodLint {
2323
// Check our expr is calling a method with pattern matching
2424
if let hir::ExprKind::MethodCall(path, _, [self_arg, ..]) = &expr.kind
2525
// Check if the name of this method is `our_fancy_method`
26-
&& path.ident.name == sym!(our_fancy_method)
26+
&& path.ident.name.as_str() == "our_fancy_method"
2727
// We can check the type of the self argument whenever necessary.
2828
// (It's necessary if we want to check that method is specifically belonging to a specific trait,
2929
// for example, a `map` method could belong to user-defined trait instead of to `Iterator`)
@@ -41,10 +41,6 @@ information on the pattern matching. As mentioned in [Define
4141
Lints](defining_lints.md#lint-types), the `methods` lint type is full of pattern
4242
matching with `MethodCall` in case the reader wishes to explore more.
4343

44-
Additionally, we use the [`clippy_utils::sym!`][sym] macro to conveniently
45-
convert an input `our_fancy_method` into a `Symbol` and compare that symbol to
46-
the [`Ident`]'s name in the [`PathSegment`] in the [`MethodCall`].
47-
4844
## Checking if a `impl` block implements a method
4945

5046
While sometimes we want to check whether a method is being called or not, other
@@ -71,7 +67,7 @@ impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
7167
// Check if item is a method/function
7268
if let ImplItemKind::Fn(ref signature, _) = impl_item.kind
7369
// Check the method is named `our_fancy_method`
74-
&& impl_item.ident.name == sym!(our_fancy_method)
70+
&& impl_item.ident.name.as_str() == "our_fancy_method"
7571
// We can also check it has a parameter `self`
7672
&& signature.decl.implicit_self.has_implicit_self()
7773
// We can go even further and even check if its return type is `String`
@@ -85,9 +81,6 @@ impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
8581

8682
[`check_impl_item`]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/trait.LateLintPass.html#method.check_impl_item
8783
[`ExprKind`]: https://doc.rust-lang.org/beta/nightly-rustc/rustc_hir/hir/enum.ExprKind.html
88-
[`Ident`]: https://doc.rust-lang.org/beta/nightly-rustc/rustc_span/symbol/struct.Ident.html
8984
[`ImplItem`]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_hir/hir/struct.ImplItem.html
9085
[`LateLintPass`]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/trait.LateLintPass.html
9186
[`MethodCall`]: https://doc.rust-lang.org/beta/nightly-rustc/rustc_hir/hir/enum.ExprKind.html#variant.MethodCall
92-
[`PathSegment`]: https://doc.rust-lang.org/beta/nightly-rustc/rustc_hir/hir/struct.PathSegment.html
93-
[sym]: https://doc.rust-lang.org/stable/nightly-rustc/clippy_utils/macro.sym.html

clippy_lints/src/casts/cast_ptr_alignment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
2020
);
2121
lint_cast_ptr_alignment(cx, expr, cast_from, cast_to);
2222
} else if let ExprKind::MethodCall(method_path, self_arg, [], _) = &expr.kind {
23-
if method_path.ident.name == sym!(cast)
23+
if method_path.ident.name.as_str() == "cast"
2424
&& let Some(generic_args) = method_path.args
2525
&& let [GenericArg::Type(cast_to)] = generic_args.args
2626
// There probably is no obvious reason to do this, just to be consistent with `as` cases.

clippy_lints/src/declared_lints.rs

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ pub static LINTS: &[&crate::LintInfo] = &[
2828
#[cfg(feature = "internal")]
2929
crate::utils::internal_lints::produce_ice::PRODUCE_ICE_INFO,
3030
#[cfg(feature = "internal")]
31+
crate::utils::internal_lints::slow_symbol_comparisons::SLOW_SYMBOL_COMPARISONS_INFO,
32+
#[cfg(feature = "internal")]
3133
crate::utils::internal_lints::unnecessary_def_path::UNNECESSARY_DEF_PATH_INFO,
3234
#[cfg(feature = "internal")]
3335
crate::utils::internal_lints::unsorted_clippy_utils_paths::UNSORTED_CLIPPY_UTILS_PATHS_INFO,

clippy_lints/src/explicit_write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitWrite {
5858
// match call to write_fmt
5959
&& let ExprKind::MethodCall(write_fun, write_recv, [write_arg], _) = *look_in_block(cx, &write_call.kind)
6060
&& let ExprKind::Call(write_recv_path, []) = write_recv.kind
61-
&& write_fun.ident.name == sym!(write_fmt)
61+
&& write_fun.ident.name.as_str() == "write_fmt"
6262
&& let Some(def_id) = path_def_id(cx, write_recv_path)
6363
{
6464
// match calls to std::io::stdout() / std::io::stderr ()

clippy_lints/src/from_raw_with_void_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl LateLintPass<'_> for FromRawWithVoidPtr {
4141
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
4242
if let ExprKind::Call(box_from_raw, [arg]) = expr.kind
4343
&& let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_from_raw.kind
44-
&& seg.ident.name == sym!(from_raw)
44+
&& seg.ident.name.as_str() == "from_raw"
4545
&& let Some(type_str) = path_def_id(cx, ty).and_then(|id| def_id_matches_type(cx, id))
4646
&& let arg_kind = cx.typeck_results().expr_ty(arg).kind()
4747
&& let ty::RawPtr(ty, _) = arg_kind

clippy_lints/src/implicit_hasher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'_, '_, 'tcx> {
340340
if self.cx.tcx.is_diagnostic_item(sym::HashMap, ty_did) {
341341
if method.ident.name == sym::new {
342342
self.suggestions.insert(e.span, "HashMap::default()".to_string());
343-
} else if method.ident.name == sym!(with_capacity) {
343+
} else if method.ident.name.as_str() == "with_capacity" {
344344
self.suggestions.insert(
345345
e.span,
346346
format!(
@@ -352,7 +352,7 @@ impl<'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'_, '_, 'tcx> {
352352
} else if self.cx.tcx.is_diagnostic_item(sym::HashSet, ty_did) {
353353
if method.ident.name == sym::new {
354354
self.suggestions.insert(e.span, "HashSet::default()".to_string());
355-
} else if method.ident.name == sym!(with_capacity) {
355+
} else if method.ident.name.as_str() == "with_capacity" {
356356
self.suggestions.insert(
357357
e.span,
358358
format!(

clippy_lints/src/infinite_iter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fn is_infinite(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {
157157
.and(cap);
158158
}
159159
}
160-
if method.ident.name == sym!(flat_map) && args.len() == 1 {
160+
if method.ident.name.as_str() == "flat_map" && args.len() == 1 {
161161
if let ExprKind::Closure(&Closure { body, .. }) = args[0].kind {
162162
let body = cx.tcx.hir().body(body);
163163
return is_infinite(cx, body.value);
@@ -224,7 +224,7 @@ fn complete_infinite_iter(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {
224224
return MaybeInfinite.and(is_infinite(cx, receiver));
225225
}
226226
}
227-
if method.ident.name == sym!(last) && args.is_empty() {
227+
if method.ident.name.as_str() == "last" && args.is_empty() {
228228
let not_double_ended = cx
229229
.tcx
230230
.get_diagnostic_item(sym::DoubleEndedIterator)
@@ -234,7 +234,7 @@ fn complete_infinite_iter(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness {
234234
if not_double_ended {
235235
return is_infinite(cx, receiver);
236236
}
237-
} else if method.ident.name == sym!(collect) {
237+
} else if method.ident.name.as_str() == "collect" {
238238
let ty = cx.typeck_results().expr_ty(expr);
239239
if matches!(
240240
get_type_diagnostic_name(cx, ty),

clippy_lints/src/iter_without_into_iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl LateLintPass<'_> for IterWithoutIntoIter {
142142
ty.peel_refs().is_slice() || get_adt_inherent_method(cx, ty, expected_method_name).is_some()
143143
})
144144
&& let Some(iter_assoc_span) = imp.items.iter().find_map(|item| {
145-
if item.ident.name == sym!(IntoIter) {
145+
if item.ident.name.as_str() == "IntoIter" {
146146
Some(cx.tcx.hir().impl_item(item.id).expect_type().span)
147147
} else {
148148
None

clippy_lints/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
603603
store.register_late_pass(|_| {
604604
Box::new(utils::internal_lints::almost_standard_lint_formulation::AlmostStandardFormulation::new())
605605
});
606+
store.register_late_pass(|_| Box::new(utils::internal_lints::slow_symbol_comparisons::SlowSymbolComparisons));
606607
}
607608

608609
store.register_late_pass(move |_| Box::new(operators::arithmetic_side_effects::ArithmeticSideEffects::new(conf)));

clippy_lints/src/manual_hash_one.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl LateLintPass<'_> for ManualHashOne {
6868
&& let Some(init) = local.init
6969
&& !init.span.from_expansion()
7070
&& let ExprKind::MethodCall(seg, build_hasher, [], _) = init.kind
71-
&& seg.ident.name == sym!(build_hasher)
71+
&& seg.ident.name.as_str() == "build_hasher"
7272

7373
&& let Node::Stmt(local_stmt) = cx.tcx.parent_hir_node(local.hir_id)
7474
&& let Node::Block(block) = cx.tcx.parent_hir_node(local_stmt.hir_id)
@@ -96,7 +96,7 @@ impl LateLintPass<'_> for ManualHashOne {
9696
&& let Node::Expr(finish_expr) = cx.tcx.parent_hir_node(path_expr.hir_id)
9797
&& !finish_expr.span.from_expansion()
9898
&& let ExprKind::MethodCall(seg, _, [], _) = finish_expr.kind
99-
&& seg.ident.name == sym!(finish)
99+
&& seg.ident.name.as_str() == "finish"
100100

101101
&& self.msrv.meets(msrvs::BUILD_HASHER_HASH_ONE)
102102
{

clippy_lints/src/manual_is_ascii_check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck {
105105
check_is_ascii(cx, macro_call.span, recv, &range, None);
106106
}
107107
} else if let ExprKind::MethodCall(path, receiver, [arg], ..) = expr.kind
108-
&& path.ident.name == sym!(contains)
108+
&& path.ident.name.as_str() == "contains"
109109
&& let Some(higher::Range {
110110
start: Some(start),
111111
end: Some(end),

clippy_lints/src/matches/redundant_guards.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir::def::{DefKind, Res};
1010
use rustc_hir::{Arm, BinOpKind, Expr, ExprKind, MatchSource, Node, PatKind, UnOp};
1111
use rustc_lint::LateContext;
1212
use rustc_span::symbol::Ident;
13-
use rustc_span::{Span, Symbol, sym};
13+
use rustc_span::{Span, sym};
1414
use std::borrow::Cow;
1515
use std::ops::ControlFlow;
1616

@@ -95,15 +95,15 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'tcx>], msrv:
9595
} else if let ExprKind::MethodCall(path, recv, args, ..) = guard.kind
9696
&& let Some(binding) = get_pat_binding(cx, recv, outer_arm)
9797
{
98-
check_method_calls(cx, outer_arm, path.ident.name, recv, args, guard, &binding);
98+
check_method_calls(cx, outer_arm, path.ident.name.as_str(), recv, args, guard, &binding);
9999
}
100100
}
101101
}
102102

103103
fn check_method_calls<'tcx>(
104104
cx: &LateContext<'tcx>,
105105
arm: &Arm<'tcx>,
106-
method: Symbol,
106+
method: &str,
107107
recv: &Expr<'_>,
108108
args: &[Expr<'_>],
109109
if_expr: &Expr<'_>,
@@ -112,7 +112,7 @@ fn check_method_calls<'tcx>(
112112
let ty = cx.typeck_results().expr_ty(recv).peel_refs();
113113
let slice_like = ty.is_slice() || ty.is_array();
114114

115-
let sugg = if method == sym!(is_empty) {
115+
let sugg = if method == "is_empty" {
116116
// `s if s.is_empty()` becomes ""
117117
// `arr if arr.is_empty()` becomes []
118118

@@ -137,9 +137,9 @@ fn check_method_calls<'tcx>(
137137

138138
if needles.is_empty() {
139139
sugg.insert_str(1, "..");
140-
} else if method == sym!(starts_with) {
140+
} else if method == "starts_with" {
141141
sugg.insert_str(sugg.len() - 1, ", ..");
142-
} else if method == sym!(ends_with) {
142+
} else if method == "ends_with" {
143143
sugg.insert_str(1, ".., ");
144144
} else {
145145
return;

clippy_lints/src/methods/filter_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ impl<'tcx> OffendingFilterExpr<'tcx> {
234234
// the latter only calls `effect` once
235235
let side_effect_expr_span = receiver.can_have_side_effects().then_some(receiver.span);
236236

237-
if cx.tcx.is_diagnostic_item(sym::Option, recv_ty.did()) && path.ident.name == sym!(is_some) {
237+
if cx.tcx.is_diagnostic_item(sym::Option, recv_ty.did()) && path.ident.name.as_str() == "is_some" {
238238
Some(Self::IsSome {
239239
receiver,
240240
side_effect_expr_span,
241241
})
242-
} else if cx.tcx.is_diagnostic_item(sym::Result, recv_ty.did()) && path.ident.name == sym!(is_ok) {
242+
} else if cx.tcx.is_diagnostic_item(sym::Result, recv_ty.did()) && path.ident.name.as_str() == "is_ok" {
243243
Some(Self::IsOk {
244244
receiver,
245245
side_effect_expr_span,

clippy_lints/src/methods/needless_collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<'tcx> Visitor<'tcx> for IterFunctionVisitor<'_, 'tcx> {
322322
// Check function calls on our collection
323323
if let ExprKind::MethodCall(method_name, recv, args, _) = &expr.kind {
324324
if args.is_empty()
325-
&& method_name.ident.name == sym!(collect)
325+
&& method_name.ident.name.as_str() == "collect"
326326
&& is_trait_method(self.cx, expr, sym::Iterator)
327327
{
328328
self.current_mutably_captured_ids = get_captured_ids(self.cx, self.cx.typeck_results().expr_ty(recv));

clippy_lints/src/methods/read_line_without_trim.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn check(cx: &LateContext<'_>, call: &Expr<'_>, recv: &Expr<'_>, arg: &Expr<
4444
if let Some(parent) = get_parent_expr(cx, expr) {
4545
let data = if let ExprKind::MethodCall(segment, recv, args, span) = parent.kind {
4646
if args.is_empty()
47-
&& segment.ident.name == sym!(parse)
47+
&& segment.ident.name.as_str() == "parse"
4848
&& let parse_result_ty = cx.typeck_results().expr_ty(parent)
4949
&& is_type_diagnostic_item(cx, parse_result_ty, sym::Result)
5050
&& let ty::Adt(_, substs) = parse_result_ty.kind()
@@ -58,7 +58,7 @@ pub fn check(cx: &LateContext<'_>, call: &Expr<'_>, recv: &Expr<'_>, arg: &Expr<
5858
"calling `.parse()` on a string without trimming the trailing newline character",
5959
"checking",
6060
))
61-
} else if segment.ident.name == sym!(ends_with)
61+
} else if segment.ident.name.as_str() == "ends_with"
6262
&& recv.span == expr.span
6363
&& let [arg] = args
6464
&& expr_is_string_literal_without_trailing_newline(arg)

clippy_lints/src/methods/unnecessary_filter_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn check_expression<'tcx>(cx: &LateContext<'tcx>, arg_id: hir::HirId, expr: &'tc
7878
(true, true)
7979
},
8080
hir::ExprKind::MethodCall(segment, recv, [arg], _) => {
81-
if segment.ident.name == sym!(then_some)
81+
if segment.ident.name.as_str() == "then_some"
8282
&& cx.typeck_results().expr_ty(recv).is_bool()
8383
&& path_to_local_id(arg, arg_id)
8484
{

clippy_lints/src/minmax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ fn min_max<'a, 'tcx>(cx: &LateContext<'tcx>, expr: &'a Expr<'a>) -> Option<(MinM
7979
},
8080
ExprKind::MethodCall(path, receiver, args @ [_], _) => {
8181
if cx.typeck_results().expr_ty(receiver).is_floating_point() || is_trait_method(cx, expr, sym::Ord) {
82-
if path.ident.name == sym!(max) {
82+
if path.ident.name.as_str() == "max" {
8383
fetch_const(cx, Some(receiver), args, MinMax::Max)
84-
} else if path.ident.name == sym!(min) {
84+
} else if path.ident.name.as_str() == "min" {
8585
fetch_const(cx, Some(receiver), args, MinMax::Min)
8686
} else {
8787
None

clippy_lints/src/missing_fields_in_debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn should_lint<'tcx>(
116116

117117
if path.ident.name == sym::debug_struct && is_type_diagnostic_item(cx, recv_ty, sym::Formatter) {
118118
has_debug_struct = true;
119-
} else if path.ident.name == sym!(finish_non_exhaustive)
119+
} else if path.ident.name.as_str() == "finish_non_exhaustive"
120120
&& is_type_diagnostic_item(cx, recv_ty, sym::DebugStruct)
121121
{
122122
has_finish_non_exhaustive = true;

clippy_lints/src/non_octal_unix_permissions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ impl<'tcx> LateLintPass<'tcx> for NonOctalUnixPermissions {
4343
match &expr.kind {
4444
ExprKind::MethodCall(path, func, [param], _) => {
4545
if let Some(adt) = cx.typeck_results().expr_ty(func).peel_refs().ty_adt_def()
46-
&& ((path.ident.name == sym!(mode)
46+
&& ((path.ident.name.as_str() == "mode"
4747
&& matches!(
4848
cx.tcx.get_diagnostic_name(adt.did()),
4949
Some(sym::FsOpenOptions | sym::DirBuilder)
5050
))
51-
|| (path.ident.name == sym!(set_mode)
51+
|| (path.ident.name.as_str() == "set_mode"
5252
&& cx.tcx.is_diagnostic_item(sym::FsPermissions, adt.did())))
5353
&& let ExprKind::Lit(_) = param.kind
5454
&& param.span.eq_ctxt(expr.span)

clippy_lints/src/operators/float_cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn is_signum(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
107107
}
108108

109109
if let ExprKind::MethodCall(method_name, self_arg, [], _) = expr.kind
110-
&& sym!(signum) == method_name.ident.name
110+
&& method_name.ident.name.as_str() == "signum"
111111
// Check that the receiver of the signum() is a float (expressions[0] is the receiver of
112112
// the method call)
113113
{

clippy_lints/src/ptr_offset_with_cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn expr_as_ptr_offset_call<'tcx>(
9696
if path_segment.ident.name == sym::offset {
9797
return Some((arg_0, arg_1, Method::Offset));
9898
}
99-
if path_segment.ident.name == sym!(wrapping_offset) {
99+
if path_segment.ident.name.as_str() == "wrapping_offset" {
100100
return Some((arg_0, arg_1, Method::WrappingOffset));
101101
}
102102
}

clippy_lints/src/question_mark.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ fn is_early_return(smbl: Symbol, cx: &LateContext<'_>, if_block: &IfBlockType<'_
163163
is_type_diagnostic_item(cx, caller_ty, smbl)
164164
&& expr_return_none_or_err(smbl, cx, if_then, caller, None)
165165
&& match smbl {
166-
sym::Option => call_sym == sym!(is_none),
167-
sym::Result => call_sym == sym!(is_err),
166+
sym::Option => call_sym.as_str() == "is_none",
167+
sym::Result => call_sym.as_str() == "is_err",
168168
_ => false,
169169
}
170170
},

0 commit comments

Comments
 (0)