Remove constraints argument from path_all
It was never used
This commit is contained in:
parent
5349e69ae2
commit
67d88f607e
6 changed files with 13 additions and 14 deletions
|
@ -14,20 +14,19 @@ pub trait AstBuilder {}
|
|||
|
||||
impl<'a> ExtCtxt<'a> {
|
||||
pub fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
|
||||
self.path_all(span, false, strs, vec![], vec![])
|
||||
self.path_all(span, false, strs, vec![])
|
||||
}
|
||||
pub fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path {
|
||||
self.path(span, vec![id])
|
||||
}
|
||||
pub fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
|
||||
self.path_all(span, true, strs, vec![], vec![])
|
||||
self.path_all(span, true, strs, vec![])
|
||||
}
|
||||
pub fn path_all(&self,
|
||||
span: Span,
|
||||
global: bool,
|
||||
mut idents: Vec<ast::Ident> ,
|
||||
args: Vec<ast::GenericArg>,
|
||||
constraints: Vec<ast::AssocTyConstraint> )
|
||||
args: Vec<ast::GenericArg>)
|
||||
-> ast::Path {
|
||||
assert!(!idents.is_empty());
|
||||
let add_root = global && !idents[0].is_path_segment_keyword();
|
||||
|
@ -39,8 +38,8 @@ impl<'a> ExtCtxt<'a> {
|
|||
segments.extend(idents.into_iter().map(|ident| {
|
||||
ast::PathSegment::from_ident(ident.with_span_pos(span))
|
||||
}));
|
||||
let args = if !args.is_empty() || !constraints.is_empty() {
|
||||
ast::AngleBracketedArgs { args, constraints, span }.into()
|
||||
let args = if !args.is_empty() {
|
||||
ast::AngleBracketedArgs { args, constraints: Vec::new(), span }.into()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
|
@ -115,7 +115,7 @@ fn cs_clone_shallow(name: &str,
|
|||
let span = cx.with_def_site_ctxt(span);
|
||||
let assert_path = cx.path_all(span, true,
|
||||
cx.std_path(&[sym::clone, Symbol::intern(helper_name)]),
|
||||
vec![GenericArg::Type(ty)], vec![]);
|
||||
vec![GenericArg::Type(ty)]);
|
||||
stmts.push(cx.stmt_let_type_only(span, cx.ty_path(assert_path)));
|
||||
}
|
||||
fn process_variant(cx: &mut ExtCtxt<'_>, stmts: &mut Vec<ast::Stmt>, variant: &VariantData) {
|
||||
|
|
|
@ -56,7 +56,7 @@ fn cs_total_eq_assert(cx: &mut ExtCtxt<'_>,
|
|||
let span = cx.with_def_site_ctxt(span);
|
||||
let assert_path = cx.path_all(span, true,
|
||||
cx.std_path(&[sym::cmp, Symbol::intern(helper_name)]),
|
||||
vec![GenericArg::Type(ty)], vec![]);
|
||||
vec![GenericArg::Type(ty)]);
|
||||
stmts.push(cx.stmt_let_type_only(span, cx.ty_path(assert_path)));
|
||||
}
|
||||
fn process_variant(cx: &mut ExtCtxt<'_>,
|
||||
|
|
|
@ -664,7 +664,7 @@ impl<'a> TraitDef<'a> {
|
|||
}).collect();
|
||||
|
||||
// Create the type of `self`.
|
||||
let path = cx.path_all(self.span, false, vec![type_ident], self_params, vec![]);
|
||||
let path = cx.path_all(self.span, false, vec![type_ident], self_params);
|
||||
let self_type = cx.ty_path(path);
|
||||
|
||||
let attr = cx.attribute(cx.meta_word(self.span, sym::automatically_derived));
|
||||
|
|
|
@ -82,12 +82,12 @@ impl<'a> Path<'a> {
|
|||
.collect();
|
||||
|
||||
match self.kind {
|
||||
PathKind::Global => cx.path_all(span, true, idents, params, Vec::new()),
|
||||
PathKind::Local => cx.path_all(span, false, idents, params, Vec::new()),
|
||||
PathKind::Global => cx.path_all(span, true, idents, params),
|
||||
PathKind::Local => cx.path_all(span, false, idents, params),
|
||||
PathKind::Std => {
|
||||
let def_site = cx.with_def_site_ctxt(DUMMY_SP);
|
||||
idents.insert(0, Ident::new(kw::DollarCrate, def_site));
|
||||
cx.path_all(span, false, idents, params, Vec::new())
|
||||
cx.path_all(span, false, idents, params)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ impl<'a> Ty<'a> {
|
|||
}
|
||||
}).collect();
|
||||
|
||||
cx.path_all(span, false, vec![self_ty], params, vec![])
|
||||
cx.path_all(span, false, vec![self_ty], params)
|
||||
}
|
||||
Literal(ref p) => p.to_path(cx, span, self_ty, generics),
|
||||
Ptr(..) => cx.span_bug(span, "pointer in a path in generic `derive`"),
|
||||
|
|
|
@ -32,7 +32,7 @@ pub fn expand_option_env<'cx>(cx: &'cx mut ExtCtxt<'_>,
|
|||
Ident::new(sym::str, sp)),
|
||||
Some(lt),
|
||||
ast::Mutability::Immutable))],
|
||||
vec![]))
|
||||
))
|
||||
}
|
||||
Ok(s) => {
|
||||
cx.expr_call_global(sp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue