about summary refs log tree commit diff
path: root/src/libsyntax/ext/proc_macro_server.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-11 03:00:05 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-15 20:39:27 +0300
commit73dee258c19a6e9e8249a0d7ff1db54014d0c7a1 (patch)
treec8d742151c2b460235059195250a8fb27ef170d0 /src/libsyntax/ext/proc_macro_server.rs
parent6cb28b6617e25b74389f1cee2ec0335c2ccfb865 (diff)
downloadrust-73dee258c19a6e9e8249a0d7ff1db54014d0c7a1.tar.gz
rust-73dee258c19a6e9e8249a0d7ff1db54014d0c7a1.zip
hygiene: Remove `Option`s from functions returning `ExpnInfo`
The expansion info is not optional and should always exist
Diffstat (limited to 'src/libsyntax/ext/proc_macro_server.rs')
-rw-r--r--src/libsyntax/ext/proc_macro_server.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ext/proc_macro_server.rs b/src/libsyntax/ext/proc_macro_server.rs
index fd93910004e..d370431a5da 100644
--- a/src/libsyntax/ext/proc_macro_server.rs
+++ b/src/libsyntax/ext/proc_macro_server.rs
@@ -362,7 +362,7 @@ pub(crate) struct Rustc<'a> {
 impl<'a> Rustc<'a> {
     pub fn new(cx: &'a ExtCtxt<'_>) -> Self {
         // No way to determine def location for a proc macro right now, so use call location.
-        let location = cx.current_expansion.id.expn_info().unwrap().call_site;
+        let location = cx.current_expansion.id.expn_info().call_site;
         let to_span = |transparency| {
             location.with_ctxt(
                 SyntaxContext::root()
@@ -677,7 +677,7 @@ impl server::Span for Rustc<'_> {
         self.sess.source_map().lookup_char_pos(span.lo()).file
     }
     fn parent(&mut self, span: Self::Span) -> Option<Self::Span> {
-        span.ctxt().outer_expn_info().map(|i| i.call_site)
+        span.parent()
     }
     fn source(&mut self, span: Self::Span) -> Self::Span {
         span.source_callsite()