mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-07 13:15:06 +00:00
Make dependency get-size2
truly optional in ruff_python_ast
(#19052)
Gates all uses of `get-size2` behind the feature `get-size` in the crate `ruff_python_ast`. Also requires that `ruff_text_size` is pulled in with the feature `get-size` enabled if we enable the same-named feature for `ruff_python_ast`.
This commit is contained in:
parent
28ab61d885
commit
4bc170a5c1
3 changed files with 9 additions and 2 deletions
|
@ -41,7 +41,10 @@ serde = [
|
|||
"dep:ruff_cache",
|
||||
"compact_str/serde",
|
||||
]
|
||||
get-size = ["dep:get-size2"]
|
||||
get-size = [
|
||||
"dep:get-size2",
|
||||
"ruff_text_size/get-size"
|
||||
]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -19,7 +19,8 @@ where
|
|||
///
|
||||
/// This type is interiorly mutable to allow assigning node indices
|
||||
/// on-demand after parsing.
|
||||
#[derive(Default, get_size2::GetSize)]
|
||||
#[derive(Default)]
|
||||
#[cfg_attr(feature = "get-size", derive(get_size2::GetSize))]
|
||||
pub struct AtomicNodeIndex(AtomicU32);
|
||||
|
||||
impl AtomicNodeIndex {
|
||||
|
|
|
@ -875,6 +875,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "get-size")]
|
||||
impl get_size2::GetSize for InterpolatedStringFlagsInner {}
|
||||
|
||||
/// Flags that can be queried to obtain information
|
||||
|
@ -1462,6 +1463,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "get-size")]
|
||||
impl get_size2::GetSize for StringLiteralFlagsInner {}
|
||||
|
||||
/// Flags that can be queried to obtain information
|
||||
|
@ -1880,6 +1882,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "get-size")]
|
||||
impl get_size2::GetSize for BytesLiteralFlagsInner {}
|
||||
|
||||
/// Flags that can be queried to obtain information
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue