tcx.sess.span_err(ast_ty.span,
"variadic function must have C calling convention");
}
- ty::mk_bare_fn(tcx, ty_of_bare_fn(this, ast_ty.id, bf.purity,
+ ty::mk_bare_fn(tcx, ty_of_bare_fn(this, ast_ty.id, bf.fn_style,
bf.abi, bf.decl))
}
ast::TyClosure(ref f) => {
rscope,
ast_ty.id,
f.sigil,
- f.purity,
+ f.fn_style,
f.onceness,
bounds,
&f.region,
let path_str = path_to_str(path);
tcx.sess.span_err(
ast_ty.span,
- format!("reference to trait `{}` where a type is expected; \
- try `@{}`, `~{}`, or `&{}`",
- path_str, path_str, path_str, path_str));
+ format!("reference to trait `{name}` where a type is expected; \
+ try `~{name}` or `&{name}`", name=path_str));
ty::mk_err()
}
ast::DefTy(did) | ast::DefStruct(did) => {
pub fn ty_of_method<AC:AstConv>(
this: &AC,
id: ast::NodeId,
- purity: ast::Purity,
+ fn_style: ast::FnStyle,
untransformed_self_ty: ty::t,
explicit_self: ast::ExplicitSelf,
decl: &ast::FnDecl) -> ty::BareFnTy {
- ty_of_method_or_bare_fn(this, id, purity, abi::Rust, Some(SelfInfo {
+ ty_of_method_or_bare_fn(this, id, fn_style, abi::Rust, Some(SelfInfo {
untransformed_self_ty: untransformed_self_ty,
explicit_self: explicit_self
}), decl)
}
pub fn ty_of_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
- purity: ast::Purity, abi: abi::Abi,
+ fn_style: ast::FnStyle, abi: abi::Abi,
decl: &ast::FnDecl) -> ty::BareFnTy {
- ty_of_method_or_bare_fn(this, id, purity, abi, None, decl)
+ ty_of_method_or_bare_fn(this, id, fn_style, abi, None, decl)
}
fn ty_of_method_or_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
- purity: ast::Purity, abi: abi::Abi,
+ fn_style: ast::FnStyle, abi: abi::Abi,
opt_self_info: Option<SelfInfo>,
decl: &ast::FnDecl) -> ty::BareFnTy {
debug!("ty_of_method_or_bare_fn");
};
return ty::BareFnTy {
- purity: purity,
+ fn_style: fn_style,
abi: abi,
sig: ty::FnSig {
binder_id: id,
rscope: &RS,
id: ast::NodeId,
sigil: ast::Sigil,
- purity: ast::Purity,
+ fn_style: ast::FnStyle,
onceness: ast::Onceness,
bounds: ty::BuiltinBounds,
opt_lifetime: &Option<ast::Lifetime>,
};
ty::ClosureTy {
- purity: purity,
+ fn_style: fn_style,
sigil: sigil,
onceness: onceness,
region: bound_region,