diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-09 14:07:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-09 14:07:29 +0200 |
| commit | 714c8ea9b5f1c15fec4211eef2ea04385fe4d386 (patch) | |
| tree | 2a6ba0b6e5280ac86fa97e80c5e4eab237a99d71 /src/libsyntax_ext/format.rs | |
| parent | a03872645fc655125e43e56bd12c335b2fb19c2e (diff) | |
| parent | d9d9246418ae884cb67feb3574832696660b8e2e (diff) | |
| download | rust-714c8ea9b5f1c15fec4211eef2ea04385fe4d386.tar.gz rust-714c8ea9b5f1c15fec4211eef2ea04385fe4d386.zip | |
Rollup merge of #63114 - matthewjasper:hygienic-format-args, r=petrochenkov
Remove gensym in format_args This also fixes some things to allow us to export opaque macros from libcore: * Don't consider items that are only reachable through opaque macros as public/exported (so they aren't linted as needing docs) * Mark private items reachable from the root of libcore as unstable - they are now reachable (in principle) in other crates via macros in libcore r? @petrochenkov
Diffstat (limited to 'src/libsyntax_ext/format.rs')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 2a299cc4f92..2ae13b66e28 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -645,7 +645,7 @@ impl<'a, 'b> Context<'a, 'b> { let mut heads = Vec::with_capacity(self.args.len()); let names_pos: Vec<_> = (0..self.args.len()) - .map(|i| self.ecx.ident_of(&format!("arg{}", i)).gensym()) + .map(|i| ast::Ident::from_str_and_span(&format!("arg{}", i), self.macsp)) .collect(); // First, build up the static array which will become our precompiled @@ -842,7 +842,7 @@ pub fn expand_preparsed_format_args( let arg_unique_types: Vec<_> = (0..args.len()).map(|_| Vec::new()).collect(); let mut macsp = ecx.call_site(); - macsp = macsp.apply_mark(ecx.current_expansion.id); + macsp = macsp.with_ctxt(ecx.backtrace()); let msg = "format argument must be a string literal"; let fmt_sp = efmt.span; |
