diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-08-31 20:08:06 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-09-03 21:15:45 +0300 |
| commit | fa893a322570ea60cc8815b3dddb5311f0cb3b63 (patch) | |
| tree | e693cfd3e9ad5b53aba23bcfe17725afa749aa48 /src/libsyntax_ext/format.rs | |
| parent | b3146549abf25818fecfc7555f35358a948e27ad (diff) | |
| download | rust-fa893a322570ea60cc8815b3dddb5311f0cb3b63.tar.gz rust-fa893a322570ea60cc8815b3dddb5311f0cb3b63.zip | |
use TokenStream rather than &[TokenTree] for built-in macros
That way, we don't loose the jointness info
Diffstat (limited to 'src/libsyntax_ext/format.rs')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 47394c02b41..ad275f421af 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -11,7 +11,7 @@ use syntax::ext::base::{self, *}; use syntax::parse::token; use syntax::ptr::P; use syntax::symbol::{Symbol, sym}; -use syntax::tokenstream; +use syntax::tokenstream::TokenStream; use syntax_pos::{MultiSpan, Span}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; @@ -126,7 +126,7 @@ struct Context<'a, 'b> { fn parse_args<'a>( ecx: &mut ExtCtxt<'a>, sp: Span, - tts: &[tokenstream::TokenTree] + tts: TokenStream, ) -> Result<(P<ast::Expr>, Vec<P<ast::Expr>>, FxHashMap<Symbol, usize>), DiagnosticBuilder<'a>> { let mut args = Vec::<P<ast::Expr>>::new(); let mut names = FxHashMap::<Symbol, usize>::default(); @@ -794,7 +794,7 @@ impl<'a, 'b> Context<'a, 'b> { fn expand_format_args_impl<'cx>( ecx: &'cx mut ExtCtxt<'_>, mut sp: Span, - tts: &[tokenstream::TokenTree], + tts: TokenStream, nl: bool, ) -> Box<dyn base::MacResult + 'cx> { sp = ecx.with_def_site_ctxt(sp); @@ -812,7 +812,7 @@ fn expand_format_args_impl<'cx>( pub fn expand_format_args<'cx>( ecx: &'cx mut ExtCtxt<'_>, sp: Span, - tts: &[tokenstream::TokenTree], + tts: TokenStream, ) -> Box<dyn base::MacResult + 'cx> { expand_format_args_impl(ecx, sp, tts, false) } @@ -820,7 +820,7 @@ pub fn expand_format_args<'cx>( pub fn expand_format_args_nl<'cx>( ecx: &'cx mut ExtCtxt<'_>, sp: Span, - tts: &[tokenstream::TokenTree], + tts: TokenStream, ) -> Box<dyn base::MacResult + 'cx> { expand_format_args_impl(ecx, sp, tts, true) } |
