diff options
| author | bobtwinkles <srkoser+GitHub@gmail.com> | 2018-04-21 18:15:54 -0400 |
|---|---|---|
| committer | bobtwinkles <srkoser+GitHub@gmail.com> | 2018-04-23 23:59:58 -0400 |
| commit | 263b36b071ba8b52cd4f79ca36494b05d4762430 (patch) | |
| tree | 8b3471fd52750a0ae4c0fea9138d9fc081f60199 /src/libproc_macro | |
| parent | d2dc21df02a6f24b0c5629d3c3ebc7c9b85d20da (diff) | |
| download | rust-263b36b071ba8b52cd4f79ca36494b05d4762430.tar.gz rust-263b36b071ba8b52cd4f79ca36494b05d4762430.zip | |
Implement parent() on `syntax_pos::Span`
... and reimplement proc_macro::Span::parent using it. This function turns out to be useful in the compiler as well
Diffstat (limited to 'src/libproc_macro')
| -rw-r--r-- | src/libproc_macro/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index e171216523a..4d24353a383 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -270,7 +270,7 @@ impl Span { /// `self` was generated from, if any. #[unstable(feature = "proc_macro", issue = "38356")] pub fn parent(&self) -> Option<Span> { - self.0.ctxt().outer().expn_info().map(|i| Span(i.call_site)) + self.0.parent().map(|x| { Span(x) }) } /// The span for the origin source code that `self` was generated from. If |
