diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-09-30 12:38:02 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-09-30 12:45:33 +0200 |
| commit | bc1b4216a802d09e8d00dd277a0e204d49bcaa7f (patch) | |
| tree | 31dabd48d5062fdd684797ed6053bf279ba67490 /src/syntax/span.rs | |
| parent | fee5170a68a6ef97108d731a4873787894f65a06 (diff) | |
Reorganize syntax types into two modules 📦
Diffstat (limited to 'src/syntax/span.rs')
| -rw-r--r-- | src/syntax/span.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs index 89f773c7..9357c345 100644 --- a/src/syntax/span.rs +++ b/src/syntax/span.rs @@ -14,12 +14,6 @@ thread_local! { static CMP_SPANS: Cell<bool> = Cell::new(true); } -/// When set to `false` comparisons with `PartialEq` ignore spans. -#[cfg(test)] -pub(crate) fn set_cmp(cmp: bool) { - CMP_SPANS.with(|cell| cell.set(cmp)); -} - /// Span offsetting. pub trait Offset { /// Offset all spans contained in `Self` by the given position. @@ -132,6 +126,12 @@ impl Span { pub fn expand(&mut self, other: Self) { *self = Self::merge(*self, other) } + + /// When set to `false` comparisons with `PartialEq` ignore spans. + #[cfg(test)] + pub(crate) fn set_cmp(cmp: bool) { + CMP_SPANS.with(|cell| cell.set(cmp)); + } } impl Offset for Span { |
