From bc1b4216a802d09e8d00dd277a0e204d49bcaa7f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 30 Sep 2020 12:38:02 +0200 Subject: =?UTF-8?q?Reorganize=20syntax=20types=20into=20two=20modules=20?= =?UTF-8?q?=F0=9F=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/span.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/syntax/span.rs') 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 = 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 { -- cgit v1.2.3