ruff/crates/ruff_python_semantic/src
Charlie Marsh 057faabcdd
Use Flags::intersects rather than Flags::contains (#6007)
## Summary

This is equivalent for a single flag, but I think it's more likely to be
correct when the bitflags are modified -- the primary reason being that
we sometimes define flags as the union of other flags, e.g.:

```rust
const ANNOTATION = Self::TYPING_ONLY_ANNOTATION.bits() | Self::RUNTIME_ANNOTATION.bits();
```

In this case, `flags.contains(Flag::ANNOTATION)` requires that _both_
flags in the union are set, whereas `flags.intersects(Flag::ANNOTATION)`
requires that _at least one_ flag is set.
2023-07-23 02:59:31 +00:00
..
analyze Use .as_ref() in lieu of &** (#5874) 2023-07-19 00:49:13 +00:00
binding.rs Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
context.rs Remove separate ReferenceContext enum (#4631) 2023-05-24 15:12:38 +00:00
definition.rs Include function name in undocumented-param message (#5818) 2023-07-16 22:51:34 -04:00
globals.rs Make some of ruff_python_semantic pub(crate) (#5093) 2023-06-14 17:49:37 +00:00
lib.rs Move StarImport to its own module (#5186) 2023-06-20 13:12:46 -04:00
model.rs Store flags rather than ExecutionContext on references (#6006) 2023-07-23 02:54:39 +00:00
node.rs Make some of ruff_python_semantic pub(crate) (#5093) 2023-06-14 17:49:37 +00:00
reference.rs Store flags rather than ExecutionContext on references (#6006) 2023-07-23 02:54:39 +00:00
scope.rs Use Flags::intersects rather than Flags::contains (#6007) 2023-07-23 02:59:31 +00:00
star_import.rs Move StarImport to its own module (#5186) 2023-06-20 13:12:46 -04:00