diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-09-07 14:52:28 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-07 18:10:11 -0700 |
| commit | 3bd1f32cd945fab63777b71ef76f23d758e2904c (patch) | |
| tree | 8035a0aa8bf9fa926484604074427146ec295b1d /src/rustc | |
| parent | 07fe5611ade0e02109a5fa72881c6cd43bacbb29 (diff) | |
| download | rust-3bd1f32cd945fab63777b71ef76f23d758e2904c.tar.gz rust-3bd1f32cd945fab63777b71ef76f23d758e2904c.zip | |
Convert all kind bounds to camel case. Remove send, owned keywords.
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/driver/session.rs | 2 | ||||
| -rw-r--r-- | src/rustc/front/core_inject.rs | 2 | ||||
| -rw-r--r-- | src/rustc/front/test.rs | 2 | ||||
| -rw-r--r-- | src/rustc/metadata/encoder.rs | 2 | ||||
| -rw-r--r-- | src/rustc/metadata/filesearch.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/resolve.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/trans/debuginfo.rs | 4 | ||||
| -rw-r--r-- | src/rustc/middle/trans/shape.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/ty.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/astconv.rs | 18 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/check.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/collect.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer.rs | 14 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer/to_str.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer/unify.rs | 10 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/rscope.rs | 4 |
17 files changed, 41 insertions, 41 deletions
diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 22946e556e8..0665c73137c 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -271,7 +271,7 @@ fn basic_options() -> @options { } // Seems out of place, but it uses session, so I'm putting it here -fn expect<T: copy>(sess: session, opt: Option<T>, msg: fn() -> ~str) -> T { +fn expect<T: Copy>(sess: session, opt: Option<T>, msg: fn() -> ~str) -> T { diagnostic::expect(sess.diagnostic(), opt, msg) } diff --git a/src/rustc/front/core_inject.rs b/src/rustc/front/core_inject.rs index 7bdd2f06485..f198a2ca79d 100644 --- a/src/rustc/front/core_inject.rs +++ b/src/rustc/front/core_inject.rs @@ -22,7 +22,7 @@ fn use_core(crate: @ast::crate) -> bool { fn inject_libcore_ref(sess: session, crate: @ast::crate) -> @ast::crate { - fn spanned<T: copy>(x: T) -> @ast::spanned<T> { + fn spanned<T: Copy>(x: T) -> @ast::spanned<T> { return @{node: x, span: dummy_sp()}; } diff --git a/src/rustc/front/test.rs b/src/rustc/front/test.rs index e5245febbe8..5ac62379e76 100644 --- a/src/rustc/front/test.rs +++ b/src/rustc/front/test.rs @@ -212,7 +212,7 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item { return @item; } -fn nospan<T: copy>(t: T) -> ast::spanned<T> { +fn nospan<T: Copy>(t: T) -> ast::spanned<T> { return {node: t, span: dummy_sp()}; } diff --git a/src/rustc/metadata/encoder.rs b/src/rustc/metadata/encoder.rs index 41db162b954..560dc384299 100644 --- a/src/rustc/metadata/encoder.rs +++ b/src/rustc/metadata/encoder.rs @@ -866,7 +866,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::Writer, // Path and definition ID indexing -fn create_index<T: copy>(index: ~[entry<T>], hash_fn: fn@(T) -> uint) -> +fn create_index<T: Copy>(index: ~[entry<T>], hash_fn: fn@(T) -> uint) -> ~[@~[entry<T>]] { let mut buckets: ~[@mut ~[entry<T>]] = ~[]; for uint::range(0u, 256u) |_i| { vec::push(buckets, @mut ~[]); }; diff --git a/src/rustc/metadata/filesearch.rs b/src/rustc/metadata/filesearch.rs index 26363806da0..0384225de12 100644 --- a/src/rustc/metadata/filesearch.rs +++ b/src/rustc/metadata/filesearch.rs @@ -67,7 +67,7 @@ fn mk_filesearch(maybe_sysroot: Option<Path>, target_triple: str::from_slice(target_triple)} as filesearch } -fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> Option<T> { +fn search<T: Copy>(filesearch: filesearch, pick: pick<T>) -> Option<T> { let mut rslt = None; for filesearch.lib_search_paths().each |lib_search_path| { debug!("searching %s", lib_search_path.to_str()); diff --git a/src/rustc/middle/borrowck.rs b/src/rustc/middle/borrowck.rs index 70f12581245..1286a95aa02 100644 --- a/src/rustc/middle/borrowck.rs +++ b/src/rustc/middle/borrowck.rs @@ -396,7 +396,7 @@ type req_maps = { pure_map: hashmap<ast::node_id, bckerr> }; -fn save_and_restore<T:copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U { +fn save_and_restore<T:Copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U { let old_save_and_restore_t = save_and_restore_t; let u <- f(); save_and_restore_t = old_save_and_restore_t; diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 18bbb432e39..94786aa8a89 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -308,7 +308,7 @@ fn Atom(n: uint) -> Atom { } /// Creates a hash table of atoms. -fn atom_hashmap<V:copy>() -> hashmap<Atom,V> { +fn atom_hashmap<V:Copy>() -> hashmap<Atom,V> { hashmap::<Atom,V>() } diff --git a/src/rustc/middle/trans/debuginfo.rs b/src/rustc/middle/trans/debuginfo.rs index 2e5b06f0a55..056d3598a32 100644 --- a/src/rustc/middle/trans/debuginfo.rs +++ b/src/rustc/middle/trans/debuginfo.rs @@ -129,7 +129,7 @@ enum debug_metadata { retval_metadata(@metadata<retval_md>), } -fn cast_safely<T: copy, U>(val: T) -> U unsafe { +fn cast_safely<T: Copy, U>(val: T) -> U unsafe { let val2 = val; return unsafe::transmute(val2); } @@ -147,7 +147,7 @@ fn md_from_metadata<T>(val: debug_metadata) -> T unsafe { } } -fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int, +fn cached_metadata<T: Copy>(cache: metadata_cache, mdtag: int, eq: fn(md: T) -> bool) -> Option<T> unsafe { if cache.contains_key(mdtag) { let items = cache.get(mdtag); diff --git a/src/rustc/middle/trans/shape.rs b/src/rustc/middle/trans/shape.rs index 6fee6f22fe0..d65b0e1978c 100644 --- a/src/rustc/middle/trans/shape.rs +++ b/src/rustc/middle/trans/shape.rs @@ -58,7 +58,7 @@ fn mk_nominal_id(tcx: ty::ctxt, did: ast::def_id, @{did: did, parent_id: parent_id, tps: tps_norm} } -fn new_nominal_id_hash<T: copy>() -> hashmap<nominal_id, T> { +fn new_nominal_id_hash<T: Copy>() -> hashmap<nominal_id, T> { return hashmap(); } diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index b8679a3818a..e6476b57e70 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -799,7 +799,7 @@ fn mk_rcache() -> creader_cache { return map::hashmap(); } -fn new_ty_hash<V: copy>() -> map::hashmap<t, V> { +fn new_ty_hash<V: Copy>() -> map::hashmap<t, V> { map::hashmap() } @@ -2568,7 +2568,7 @@ pure fn hash_bound_region(br: &bound_region) -> uint { } } -fn br_hashmap<V:copy>() -> hashmap<bound_region, V> { +fn br_hashmap<V:Copy>() -> hashmap<bound_region, V> { map::hashmap() } @@ -3081,7 +3081,7 @@ fn occurs_check(tcx: ctxt, sp: span, vid: TyVid, rt: t) { // Maintains a little union-set tree for inferred modes. `canon()` returns // the current head value for `m0`. -fn canon<T:copy>(tbl: hashmap<ast::node_id, ast::inferable<T>>, +fn canon<T:Copy>(tbl: hashmap<ast::node_id, ast::inferable<T>>, +m0: ast::inferable<T>) -> ast::inferable<T> { match m0 { ast::infer(id) => match tbl.find(id) { diff --git a/src/rustc/middle/typeck/astconv.rs b/src/rustc/middle/typeck/astconv.rs index 85bac78da97..2ac872117e3 100644 --- a/src/rustc/middle/typeck/astconv.rs +++ b/src/rustc/middle/typeck/astconv.rs @@ -69,7 +69,7 @@ fn get_region_reporting_err(tcx: ty::ctxt, } } -fn ast_region_to_region<AC: ast_conv, RS: region_scope copy owned>( +fn ast_region_to_region<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, span: span, a_r: @ast::region) -> ty::region { let res = match a_r.node { @@ -80,7 +80,7 @@ fn ast_region_to_region<AC: ast_conv, RS: region_scope copy owned>( get_region_reporting_err(self.tcx(), span, res) } -fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>( +fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, did: ast::def_id, path: @ast::path) -> ty_param_substs_and_ty { @@ -129,7 +129,7 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>( {substs: substs, ty: ty::subst(tcx, &substs, decl_ty)} } -fn ast_path_to_ty<AC: ast_conv, RS: region_scope copy owned>( +fn ast_path_to_ty<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, did: ast::def_id, @@ -152,10 +152,10 @@ const NO_TPS: uint = 2u; // Parses the programmer's textual representation of a type into our // internal notion of a type. `getter` is a function that returns the type // corresponding to a definition ID: -fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy owned>( +fn ast_ty_to_ty<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, &&ast_ty: @ast::ty) -> ty::t { - fn ast_mt_to_mt<AC: ast_conv, RS: region_scope copy owned>( + fn ast_mt_to_mt<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, mt: ast::mt) -> ty::mt { return {ty: ast_ty_to_ty(self, rscope, mt.ty), mutbl: mt.mutbl}; @@ -164,7 +164,7 @@ fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy owned>( // Handle @, ~, and & being able to mean estrs and evecs. // If a_seq_ty is a str or a vec, make it an estr/evec. // Also handle function sigils and first-class trait types. - fn mk_maybe_vstore<AC: ast_conv, RS: region_scope copy owned>( + fn mk_maybe_vstore<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, a_seq_ty: ast::mt, vst: ty::vstore, span: span, constr: fn(ty::mt) -> ty::t) -> ty::t { @@ -400,7 +400,7 @@ fn ast_ty_to_ty<AC: ast_conv, RS: region_scope copy owned>( return typ; } -fn ty_of_arg<AC: ast_conv, RS: region_scope copy owned>( +fn ty_of_arg<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, a: ast::arg, expected_ty: Option<ty::arg>) -> ty::arg { @@ -445,7 +445,7 @@ fn ty_of_arg<AC: ast_conv, RS: region_scope copy owned>( {mode: mode, ty: ty} } -fn ast_proto_to_proto<AC: ast_conv, RS: region_scope copy owned>( +fn ast_proto_to_proto<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, span: span, ast_proto: ast::proto) -> ty::fn_proto { match ast_proto { ast::proto_bare => @@ -465,7 +465,7 @@ fn ast_proto_to_proto<AC: ast_conv, RS: region_scope copy owned>( type expected_tys = Option<{inputs: ~[ty::arg], output: ty::t}>; -fn ty_of_fn_decl<AC: ast_conv, RS: region_scope copy owned>( +fn ty_of_fn_decl<AC: ast_conv, RS: region_scope Copy Owned>( self: AC, rscope: RS, ast_proto: ast::proto, purity: ast::purity, diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index 96d9bf1e2e5..f63f6f2e125 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -1203,7 +1203,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, // through the `unpack` function. It there is no expected type or // resolution is not possible (e.g., no constraints yet present), just // returns `none`. - fn unpack_expected<O: copy>(fcx: @fn_ctxt, expected: Option<ty::t>, + fn unpack_expected<O: Copy>(fcx: @fn_ctxt, expected: Option<ty::t>, unpack: fn(ty::sty) -> Option<O>) -> Option<O> { match expected { diff --git a/src/rustc/middle/typeck/collect.rs b/src/rustc/middle/typeck/collect.rs index 3206d1709c5..0a06e554724 100644 --- a/src/rustc/middle/typeck/collect.rs +++ b/src/rustc/middle/typeck/collect.rs @@ -75,7 +75,7 @@ fn collect_item_types(ccx: @crate_ctxt, crate: @ast::crate) { } impl @crate_ctxt { - fn to_ty<RS: region_scope copy owned>( + fn to_ty<RS: region_scope Copy Owned>( rs: RS, ast_ty: @ast::ty) -> ty::t { ast_ty_to_ty(self, rs, ast_ty) diff --git a/src/rustc/middle/typeck/infer.rs b/src/rustc/middle/typeck/infer.rs index cbda05a4012..2aef5ff6b5b 100644 --- a/src/rustc/middle/typeck/infer.rs +++ b/src/rustc/middle/typeck/infer.rs @@ -298,8 +298,8 @@ export assignment; export root, to_str; export int_ty_set_all; -type bound<T:copy> = Option<T>; -type bounds<T:copy> = {lb: bound<T>, ub: bound<T>}; +type bound<T:Copy> = Option<T>; +type bounds<T:Copy> = {lb: bound<T>, ub: bound<T>}; type cres<T> = Result<T,ty::type_err>; // "combine result" type ures = cres<()>; // "unify result" @@ -348,7 +348,7 @@ fn fixup_err_to_str(f: fixup_err) -> ~str { } } -fn new_vals_and_bindings<V:copy, T:copy>() -> vals_and_bindings<V, T> { +fn new_vals_and_bindings<V:Copy, T:Copy>() -> vals_and_bindings<V, T> { vals_and_bindings { vals: smallintmap::mk(), mut bindings: ~[] @@ -458,12 +458,12 @@ fn resolve_borrowings(cx: infer_ctxt) { */ trait then { - fn then<T:copy>(f: fn() -> Result<T,ty::type_err>) + fn then<T:Copy>(f: fn() -> Result<T,ty::type_err>) -> Result<T,ty::type_err>; } impl ures: then { - fn then<T:copy>(f: fn() -> Result<T,ty::type_err>) + fn then<T:Copy>(f: fn() -> Result<T,ty::type_err>) -> Result<T,ty::type_err> { self.chain(|_i| f()) } @@ -474,7 +474,7 @@ trait cres_helpers<T> { fn compare(t: T, f: fn() -> ty::type_err) -> cres<T>; } -impl<T:copy Eq> cres<T>: cres_helpers<T> { +impl<T:Copy Eq> cres<T>: cres_helpers<T> { fn to_ures() -> ures { match self { Ok(_v) => Ok(()), @@ -497,7 +497,7 @@ fn uok() -> ures { Ok(()) } -fn rollback_to<V:copy vid, T:copy>( +fn rollback_to<V:Copy vid, T:Copy>( vb: &vals_and_bindings<V, T>, len: uint) { while vb.bindings.len() != len { diff --git a/src/rustc/middle/typeck/infer/to_str.rs b/src/rustc/middle/typeck/infer/to_str.rs index f66685d766b..7acfdcac424 100644 --- a/src/rustc/middle/typeck/infer/to_str.rs +++ b/src/rustc/middle/typeck/infer/to_str.rs @@ -23,7 +23,7 @@ impl ty::region: to_str { } } -impl<V:copy to_str> bound<V>: to_str { +impl<V:Copy to_str> bound<V>: to_str { fn to_str(cx: infer_ctxt) -> ~str { match self { Some(v) => v.to_str(cx), @@ -32,7 +32,7 @@ impl<V:copy to_str> bound<V>: to_str { } } -impl<T:copy to_str> bounds<T>: to_str { +impl<T:Copy to_str> bounds<T>: to_str { fn to_str(cx: infer_ctxt) -> ~str { fmt!("{%s <: %s}", self.lb.to_str(cx), @@ -48,7 +48,7 @@ impl int_ty_set: to_str { } } -impl<V:copy vid, T:copy to_str> var_value<V, T>: to_str { +impl<V:Copy vid, T:Copy to_str> var_value<V, T>: to_str { fn to_str(cx: infer_ctxt) -> ~str { match self { redirect(vid) => fmt!("redirect(%s)", vid.to_str()), diff --git a/src/rustc/middle/typeck/infer/unify.rs b/src/rustc/middle/typeck/infer/unify.rs index 36c3093874a..2793d0e4f5a 100644 --- a/src/rustc/middle/typeck/infer/unify.rs +++ b/src/rustc/middle/typeck/infer/unify.rs @@ -3,24 +3,24 @@ use integral::*; use to_str::to_str; use std::smallintmap::SmallIntMap; -enum var_value<V:copy, T:copy> { +enum var_value<V:Copy, T:Copy> { redirect(V), root(T, uint), } -struct vals_and_bindings<V:copy, T:copy> { +struct vals_and_bindings<V:Copy, T:Copy> { vals: SmallIntMap<var_value<V, T>>, mut bindings: ~[(V, var_value<V, T>)], } -struct node<V:copy, T:copy> { +struct node<V:Copy, T:Copy> { root: V, possible_types: T, rank: uint, } impl infer_ctxt { - fn get<V:copy vid, T:copy>( + fn get<V:Copy vid, T:Copy>( vb: &vals_and_bindings<V, T>, vid: V) -> node<V, T> { let vid_u = vid.to_uint(); @@ -46,7 +46,7 @@ impl infer_ctxt { } } - fn set<V:copy vid, T:copy to_str>( + fn set<V:Copy vid, T:Copy to_str>( vb: &vals_and_bindings<V, T>, vid: V, +new_v: var_value<V, T>) { diff --git a/src/rustc/middle/typeck/rscope.rs b/src/rustc/middle/typeck/rscope.rs index 3826d3e527c..0224d6933a7 100644 --- a/src/rustc/middle/typeck/rscope.rs +++ b/src/rustc/middle/typeck/rscope.rs @@ -46,7 +46,7 @@ fn bound_self_region(rp: Option<ty::region_variance>) -> Option<ty::region> { } enum anon_rscope = {anon: ty::region, base: region_scope}; -fn in_anon_rscope<RS: region_scope copy owned>(self: RS, r: ty::region) +fn in_anon_rscope<RS: region_scope Copy Owned>(self: RS, r: ty::region) -> @anon_rscope { @anon_rscope({anon: r, base: self as region_scope}) } @@ -63,7 +63,7 @@ struct binding_rscope { base: region_scope, mut anon_bindings: uint, } -fn in_binding_rscope<RS: region_scope copy owned>(self: RS) +fn in_binding_rscope<RS: region_scope Copy Owned>(self: RS) -> @binding_rscope { let base = self as region_scope; @binding_rscope { base: base, anon_bindings: 0 } |
