Remove unused flags and functions from the semantic model (#14318)

This commit is contained in:
Alex Waygood 2024-11-13 17:35:48 +00:00 committed by GitHub
parent eb55b9b5a0
commit 78e4753d74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 47 deletions

View file

@ -63,28 +63,10 @@ impl ResolvedReference {
.intersects(SemanticModelFlags::RUNTIME_EVALUATED_ANNOTATION)
}
/// Return `true` if the context is in a "simple" string type definition.
pub const fn in_simple_string_type_definition(&self) -> bool {
/// Return `true` if the context is in a string type definition.
pub const fn in_string_type_definition(&self) -> bool {
self.flags
.intersects(SemanticModelFlags::SIMPLE_STRING_TYPE_DEFINITION)
}
/// Return `true` if the context is in a "complex" string type definition.
pub const fn in_complex_string_type_definition(&self) -> bool {
self.flags
.intersects(SemanticModelFlags::COMPLEX_STRING_TYPE_DEFINITION)
}
/// Return `true` if the context is in a `__future__` type definition.
pub const fn in_future_type_definition(&self) -> bool {
self.flags
.intersects(SemanticModelFlags::FUTURE_TYPE_DEFINITION)
}
/// Return `true` if the context is in any kind of deferred type definition.
pub const fn in_deferred_type_definition(&self) -> bool {
self.flags
.intersects(SemanticModelFlags::DEFERRED_TYPE_DEFINITION)
.intersects(SemanticModelFlags::STRING_TYPE_DEFINITION)
}
/// Return `true` if the context is in any kind of type definition.