Skip to content

Commit 702c248

Browse files
author
Elrendio
committed
FIX - Document mocked Span::start and Span::end methods
Helps #237 **What it does:** - Adds warning on methods `Span::start` and `Span::end` methods
1 parent d2c09ab commit 702c248

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ impl Span {
436436

437437
/// Get the starting line/column in the source file for this span.
438438
///
439-
/// This method requires the `"span-locations"` feature to be enabled.
439+
/// This method requires the `"span-locations"` feature to be enabled and to be on `nightly`. On `stable` rust this
440+
/// currently returns a mocked LineColumn (`LineColumn { line: 0, column: 0 }`).
440441
#[cfg(span_locations)]
441442
pub fn start(&self) -> LineColumn {
442443
let imp::LineColumn { line, column } = self.inner.start();
@@ -445,7 +446,8 @@ impl Span {
445446

446447
/// Get the ending line/column in the source file for this span.
447448
///
448-
/// This method requires the `"span-locations"` feature to be enabled.
449+
/// This method requires the `"span-locations"` feature to be enabled and to be on `nightly`. On `stable` rust this
450+
/// currently returns a mocked LineColumn (`LineColumn { line: 0, column: 0 }`).
449451
#[cfg(span_locations)]
450452
pub fn end(&self) -> LineColumn {
451453
let imp::LineColumn { line, column } = self.inner.end();

0 commit comments

Comments
 (0)