diff options
author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-25 01:00:21 +0300 |
---|---|---|
committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-30 01:53:32 +0300 |
commit | 9f92fce77c74cf3c47035e9ff69c29daee0517b3 (patch) | |
tree | e724e8e72a43d71053f4de32fa893a661ee163bf /src/libproc_macro | |
parent | 297109ea3263a4ea90a7143a82e46903a8890269 (diff) | |
download | rust-9f92fce77c74cf3c47035e9ff69c29daee0517b3.tar.gz |
Fortify dummy span checking
Diffstat (limited to 'src/libproc_macro')
-rw-r--r-- | src/libproc_macro/lib.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index e580b459196..820b0906a75 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -177,8 +177,6 @@ impl iter::FromIterator<TokenStream> for TokenStream { #[unstable(feature = "proc_macro", issue = "38356")] pub mod token_stream { use syntax::tokenstream; - use syntax_pos::DUMMY_SP; - use {TokenTree, TokenStream, Delimiter}; /// An iterator over `TokenStream`'s `TokenTree`s. @@ -207,7 +205,7 @@ pub mod token_stream { // need to flattened during iteration over stream's token trees. // Eventually this needs to be removed in favor of keeping original token trees // and not doing the roundtrip through AST. - if tree.span().0 == DUMMY_SP { + if tree.span().0.is_dummy() { if let TokenTree::Group(ref group) = tree { if group.delimiter() == Delimiter::None { self.cursor.insert(group.stream.clone().0); |