]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/typeck/astconv.rs
auto merge of #13424 : eddyb/rust/ty-mut-in-store, r=nikomatsakis
[rust.git] / src / librustc / middle / typeck / astconv.rs
index c0cdbdf23f7997bcf47c7e9ea04447a4296d164d..3170fb82c88f6789c1107e2df398b3ac537804dc 100644 (file)
@@ -513,7 +513,7 @@ fn mk_pointer<AC:AstConv,
                     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) => {
@@ -536,7 +536,7 @@ fn mk_pointer<AC:AstConv,
                                             rscope,
                                             ast_ty.id,
                                             f.sigil,
-                                            f.purity,
+                                            f.fn_style,
                                             f.onceness,
                                             bounds,
                                             &f.region,
@@ -565,9 +565,8 @@ fn mk_pointer<AC:AstConv,
                         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) => {
@@ -655,24 +654,24 @@ struct SelfInfo {
 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");
@@ -718,7 +717,7 @@ fn ty_of_method_or_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
     };
 
     return ty::BareFnTy {
-        purity: purity,
+        fn_style: fn_style,
         abi: abi,
         sig: ty::FnSig {
             binder_id: id,
@@ -734,7 +733,7 @@ pub fn ty_of_closure<AC:AstConv,RS:RegionScope>(
     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>,
@@ -791,7 +790,7 @@ pub fn ty_of_closure<AC:AstConv,RS:RegionScope>(
     };
 
     ty::ClosureTy {
-        purity: purity,
+        fn_style: fn_style,
         sigil: sigil,
         onceness: onceness,
         region: bound_region,