Convert all kind bounds to camel case. Remove send, owned keywords.

This commit is contained in:
Brian Anderson
2012-09-07 14:52:28 -07:00
parent 07fe5611ad
commit 3bd1f32cd9
167 changed files with 613 additions and 622 deletions

View File

@@ -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)
}

View File

@@ -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()};
}

View File

@@ -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()};
}

View File

@@ -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 ~[]); };

View File

@@ -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());

View File

@@ -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;

View File

@@ -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>()
}

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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 {

View File

@@ -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()),

View File

@@ -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>) {

View File

@@ -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 }