Wrap the LineColumn struct when re-exporting from proc-macro
diff --git a/src/lib.rs b/src/lib.rs
index b70cb4b..25f61f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -141,7 +141,10 @@
// NOTE: We can't easily wrap LineColumn right now, as the version in proc-macro
// doesn't actually expose the internal `line` and `column` fields, making it
// mostly useless.
-pub use imp::LineColumn;
+pub struct LineColumn {
+ pub line: usize,
+ pub column: usize,
+}
#[derive(Copy, Clone)]
pub struct Span(imp::Span);
@@ -167,13 +170,13 @@
}
pub fn start(&self) -> LineColumn {
- // XXX(nika): We can't easily wrap LineColumn right now
- self.0.start()
+ let imp::LineColumn{ line, column } = self.0.start();
+ LineColumn { line, column }
}
pub fn end(&self) -> LineColumn {
- // XXX(nika): We can't easily wrap LineColumn right now
- self.0.end()
+ let imp::LineColumn{ line, column } = self.0.end();
+ LineColumn { line, column }
}
pub fn join(&self, other: Span) -> Option<Span> {
diff --git a/src/unstable.rs b/src/unstable.rs
index 7d4e85c..3f4ef63 100644
--- a/src/unstable.rs
+++ b/src/unstable.rs
@@ -191,8 +191,10 @@
}
}
-// XXX(nika): We can't easily wrap LineColumn right now
-pub use proc_macro::LineColumn;
+pub struct LineColumn {
+ pub line: usize,
+ pub column: usize,
+}
#[derive(Copy, Clone)]
pub struct Span(proc_macro::Span);
@@ -211,13 +213,13 @@
}
pub fn start(&self) -> LineColumn {
- // XXX(nika): We can't easily wrap LineColumn right now
- self.0.start()
+ let proc_macro::LineColumn{ line, column } = self.0.start();
+ LineColumn { line, column }
}
pub fn end(&self) -> LineColumn {
- // XXX(nika): We can't easily wrap LineColumn right now
- self.0.end()
+ let proc_macro::LineColumn{ line, column } = self.0.end();
+ LineColumn { line, column }
}
pub fn join(&self, other: Span) -> Option<Span> {