Support rust 1.15.0
diff --git a/src/lib.rs b/src/lib.rs
index de3a2e5..fd46433 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -170,13 +170,13 @@
#[cfg(procmacro2_unstable)]
pub fn start(&self) -> LineColumn {
let imp::LineColumn{ line, column } = self.0.start();
- LineColumn { line, column }
+ LineColumn { line: line, column: column }
}
#[cfg(procmacro2_unstable)]
pub fn end(&self) -> LineColumn {
let imp::LineColumn{ line, column } = self.0.end();
- LineColumn { line, column }
+ LineColumn { line: line, column: column }
}
#[cfg(procmacro2_unstable)]
diff --git a/src/stable.rs b/src/stable.rs
index 56c0dd2..d892ae5 100644
--- a/src/stable.rs
+++ b/src/stable.rs
@@ -320,22 +320,18 @@
}
impl Span {
+ #[cfg(not(procmacro2_unstable))]
pub fn call_site() -> Span {
- Span {
- #[cfg(procmacro2_unstable)]
- lo: 0,
- #[cfg(procmacro2_unstable)]
- hi: 0,
- }
+ Span {}
+ }
+
+ #[cfg(procmacro2_unstable)]
+ pub fn call_site() -> Span {
+ Span { lo: 0, hi: 0 }
}
pub fn def_site() -> Span {
- Span {
- #[cfg(procmacro2_unstable)]
- lo: 0,
- #[cfg(procmacro2_unstable)]
- hi: 0,
- }
+ Span::call_site()
}
#[cfg(procmacro2_unstable)]
diff --git a/src/strnom.rs b/src/strnom.rs
index 5f23803..2f9e73f 100644
--- a/src/strnom.rs
+++ b/src/strnom.rs
@@ -14,10 +14,16 @@
}
impl<'a> Cursor<'a> {
+ #[cfg(not(procmacro2_unstable))]
pub fn advance(&self, amt: usize) -> Cursor<'a> {
Cursor {
rest: &self.rest[amt..],
- #[cfg(procmacro2_unstable)]
+ }
+ }
+ #[cfg(procmacro2_unstable)]
+ pub fn advance(&self, amt: usize) -> Cursor<'a> {
+ Cursor {
+ rest: &self.rest[amt..],
off: self.off + (amt as u32),
}
}