use fmt_macros as parse;
-use errors::pluralize;
-use errors::Applicability;
-use errors::DiagnosticBuilder;
-
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
use rustc_expand::base::{self, *};
+use rustc_span::symbol::{sym, Symbol};
use rustc_span::{MultiSpan, Span};
use syntax::ast;
use syntax::ptr::P;
-use syntax::symbol::{sym, Symbol};
use syntax::token;
use syntax::tokenstream::TokenStream;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use std::borrow::Cow;
use std::collections::hash_map::Entry;
parse::NextArgument(ref arg) => {
// Build the position
let pos = {
- let pos = |c, arg| {
- let mut path = Context::rtpath(self.ecx, "Position");
- path.push(self.ecx.ident_of(c, sp));
- match arg {
- Some(i) => {
- let arg = self.ecx.expr_usize(sp, i);
- self.ecx.expr_call_global(sp, path, vec![arg])
- }
- None => self.ecx.expr_path(self.ecx.path_global(sp, path)),
- }
- };
match arg.position {
parse::ArgumentIs(i) | parse::ArgumentImplicitlyIs(i) => {
// Map to index in final generated argument array
arg_idx
}
};
- pos("At", Some(arg_idx))
+ self.ecx.expr_usize(sp, arg_idx)
}
// should never be the case, because names are already