FIX - Document mocked Span::start and Span::end methods (#268)

Helps #237

**What it does:**
 - Adds warning on methods `Span::start` and `Span::end` methods
This commit is contained in:
Oscar Walter 2020-11-23 16:04:01 +01:00 committed by GitHub
parent d2c09ab640
commit 3c856d2bd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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