Sha256: f55d2e61f1bb1af65e14ed04c9e91eb1ddbf8430e8c05f2048d1cd538d27368e

Contents?: true

Size: 872 Bytes

Versions: 28

Compression:

Stored size: 872 Bytes

Contents

use core::cmp::Ordering;

/// A line-column pair representing the start or end of a `Span`.
///
/// This type is semver exempt and not exposed by default.
#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct LineColumn {
    /// The 1-indexed line in the source file on which the span starts or ends
    /// (inclusive).
    pub line: usize,
    /// The 0-indexed column (in UTF-8 characters) in the source file on which
    /// the span starts or ends (inclusive).
    pub column: usize,
}

impl Ord for LineColumn {
    fn cmp(&self, other: &Self) -> Ordering {
        self.line
            .cmp(&other.line)
            .then(self.column.cmp(&other.column))
    }
}

impl PartialOrd for LineColumn {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
wasmtime-23.0.2 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-22.0.0 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-21.0.1 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-20.0.2 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-20.0.0 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-18.0.3 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-17.0.1 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-17.0.0 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-16.0.0 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-15.0.1 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-15.0.0 ./ext/cargo-vendor/proc-macro2-1.0.76/src/location.rs
wasmtime-14.0.4 ./ext/cargo-vendor/proc-macro2-1.0.69/src/location.rs
wasmtime-14.0.3 ./ext/cargo-vendor/proc-macro2-1.0.69/src/location.rs
wasmtime-14.0.1 ./ext/cargo-vendor/proc-macro2-1.0.69/src/location.rs
wasmtime-14.0.0 ./ext/cargo-vendor/proc-macro2-1.0.69/src/location.rs
wasmtime-13.0.0 ./ext/cargo-vendor/proc-macro2-1.0.66/src/location.rs
wasmtime-12.0.1 ./ext/cargo-vendor/proc-macro2-1.0.66/src/location.rs
wasmtime-12.0.0 ./ext/cargo-vendor/proc-macro2-1.0.66/src/location.rs
wasmtime-11.0.0 ./ext/cargo-vendor/proc-macro2-1.0.66/src/location.rs
wasmtime-10.0.1 ./ext/cargo-vendor/proc-macro2-1.0.66/src/location.rs