@@ -385,7 +385,7 @@ pub(crate) fn duplicate_isinstance_call(checker: &mut Checker, expr: &Expr) {
385
385
} ,
386
386
expr. range ( ) ,
387
387
) ;
388
- if !contains_effect ( target, |id| checker. semantic ( ) . is_builtin ( id) ) {
388
+ if !contains_effect ( target, |id| checker. semantic ( ) . has_builtin_binding ( id) ) {
389
389
// Grab the types used in each duplicate `isinstance` call (e.g., `int` and `str`
390
390
// in `isinstance(obj, int) or isinstance(obj, str)`).
391
391
let types: Vec < & Expr > = indices
@@ -520,7 +520,7 @@ pub(crate) fn compare_with_tuple(checker: &mut Checker, expr: &Expr) {
520
520
// Avoid rewriting (e.g.) `a == "foo" or a == f()`.
521
521
if comparators
522
522
. iter ( )
523
- . any ( |expr| contains_effect ( expr, |id| checker. semantic ( ) . is_builtin ( id) ) )
523
+ . any ( |expr| contains_effect ( expr, |id| checker. semantic ( ) . has_builtin_binding ( id) ) )
524
524
{
525
525
continue ;
526
526
}
@@ -614,7 +614,7 @@ pub(crate) fn expr_and_not_expr(checker: &mut Checker, expr: &Expr) {
614
614
return ;
615
615
}
616
616
617
- if contains_effect ( expr, |id| checker. semantic ( ) . is_builtin ( id) ) {
617
+ if contains_effect ( expr, |id| checker. semantic ( ) . has_builtin_binding ( id) ) {
618
618
return ;
619
619
}
620
620
@@ -671,7 +671,7 @@ pub(crate) fn expr_or_not_expr(checker: &mut Checker, expr: &Expr) {
671
671
return ;
672
672
}
673
673
674
- if contains_effect ( expr, |id| checker. semantic ( ) . is_builtin ( id) ) {
674
+ if contains_effect ( expr, |id| checker. semantic ( ) . has_builtin_binding ( id) ) {
675
675
return ;
676
676
}
677
677
@@ -748,14 +748,15 @@ fn is_short_circuit(
748
748
749
749
for ( index, ( value, next_value) ) in values. iter ( ) . tuple_windows ( ) . enumerate ( ) {
750
750
// Keep track of the location of the furthest-right, truthy or falsey expression.
751
- let value_truthiness = Truthiness :: from_expr ( value, |id| checker. semantic ( ) . is_builtin ( id) ) ;
751
+ let value_truthiness =
752
+ Truthiness :: from_expr ( value, |id| checker. semantic ( ) . has_builtin_binding ( id) ) ;
752
753
let next_value_truthiness =
753
- Truthiness :: from_expr ( next_value, |id| checker. semantic ( ) . is_builtin ( id) ) ;
754
+ Truthiness :: from_expr ( next_value, |id| checker. semantic ( ) . has_builtin_binding ( id) ) ;
754
755
755
756
// Keep track of the location of the furthest-right, non-effectful expression.
756
757
if value_truthiness. is_unknown ( )
757
758
&& ( !checker. semantic ( ) . in_boolean_test ( )
758
- || contains_effect ( value, |id| checker. semantic ( ) . is_builtin ( id) ) )
759
+ || contains_effect ( value, |id| checker. semantic ( ) . has_builtin_binding ( id) ) )
759
760
{
760
761
furthest = next_value;
761
762
continue ;
0 commit comments