Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit e06af88

Browse files
committed
rls-span: Add nightly feature
1 parent 163e397 commit e06af88

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

rls-span/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ serde_derive = { version = "1.0", optional = true }
1616

1717
[features]
1818
default = []
19+
nightly = []
1920
serialize-rustc = ["rustc-serialize"]
2021
derive = ["serde_derive"]

rls-span/src/lib.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
#![feature(step_trait)]
1+
#![cfg_attr(feature = "nightly", feature(step_trait))]
22

33
#[cfg(feature = "derive")]
44
#[macro_use]
55
extern crate serde_derive;
66

77
use serde::{Deserialize, Serialize};
88

9-
use std::convert::TryFrom;
10-
use std::iter::Step;
119
use std::marker::PhantomData;
1210
use std::path::PathBuf;
1311

12+
#[cfg(feature = "nightly")]
13+
use std::convert::TryFrom;
14+
#[cfg(feature = "nightly")]
15+
use std::iter::Step;
16+
1417
pub mod compiler;
1518
mod serde_expanded;
1619

@@ -82,6 +85,7 @@ impl Column<ZeroIndexed> {
8285
}
8386
}
8487

88+
#[cfg(feature = "nightly")]
8589
impl Step for Column<ZeroIndexed> {
8690
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
8791
<u32 as Step>::steps_between(&start.0, &end.0)
@@ -110,6 +114,7 @@ impl Step for Column<ZeroIndexed> {
110114
}
111115
}
112116

117+
#[cfg(feature = "nightly")]
113118
impl Step for Column<OneIndexed> {
114119
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
115120
<u32 as Step>::steps_between(&start.0, &end.0)
@@ -201,6 +206,7 @@ impl Row<ZeroIndexed> {
201206
}
202207
}
203208

209+
#[cfg(feature = "nightly")]
204210
impl Step for Row<ZeroIndexed> {
205211
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
206212
<u32 as Step>::steps_between(&start.0, &end.0)
@@ -229,6 +235,7 @@ impl Step for Row<ZeroIndexed> {
229235
}
230236
}
231237

238+
#[cfg(feature = "nightly")]
232239
impl Step for Row<OneIndexed> {
233240
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
234241
<u32 as Step>::steps_between(&start.0, &end.0)
@@ -454,6 +461,7 @@ impl Indexed for ZeroIndexed {}
454461
pub struct OneIndexed;
455462
impl Indexed for OneIndexed {}
456463

464+
#[cfg(feature = "nightly")]
457465
#[cfg(test)]
458466
mod test {
459467
use super::*;

0 commit comments

Comments
 (0)