Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that Spans are semi-open #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ impl Debug for SourceFile {
}

/// A region of source code, along with macro expansion information.
///
/// A Span is semi-open: the start location is included in the span and
/// the end is excluded.
#[derive(Copy, Clone)]
pub struct Span {
inner: imp::Span,
Expand Down Expand Up @@ -478,6 +481,9 @@ impl Span {

/// Get the ending line/column in the source file for this span.
///
/// The ending line/column is exclusive, pointing to the first character
/// after the span.
///
/// This method requires the `"span-locations"` feature to be enabled.
///
/// When executing in a procedural macro context, the returned line/column
Expand Down