Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/front/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
span: span
};

let fn_path = path_node_global(path);
let fn_path = ~path_node_global(path);

let fn_expr = @ast::expr {
id: cx.sess.next_node_id(),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
encode_name(ecx, ebml_w, item.ident);
encode_attributes(ebml_w, item.attrs);
match ty.node {
ast::ty_path(ref path, ref bounds, _) if path.idents.len() == 1 => {
ast::ty_path(~ref path, ref bounds, _) if path.idents.len() == 1 => {
assert!(bounds.is_none());
encode_impl_type_basename(ecx, ebml_w,
ast_util::path_to_ident(path));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub fn check_crate<'mm>(tcx: ty::ctxt,
_ => {}
}
}
expr_path(ref path) => {
expr_path(~ref path) => {
check_path(expr.span, tcx.def_map.get_copy(&expr.id), path);
}
expr_struct(_, ref fields, _) => {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn ty_method_might_be_inlined(ty_method: &ty_method) -> bool {
// monomorphized or it was marked with `#[inline]`.
fn trait_method_might_be_inlined(trait_method: &trait_method) -> bool {
match *trait_method {
required(ref ty_method) => ty_method_might_be_inlined(ty_method),
required(~ref ty_method) => ty_method_might_be_inlined(ty_method),
provided(_) => true
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,8 @@ fn determine_rp_in_ty(ty: &ast::Ty,
}

match ty.node {
ast::ty_box(ref mt) | ast::ty_uniq(ref mt) | ast::ty_vec(ref mt) |
ast::ty_rptr(_, ref mt) | ast::ty_ptr(ref mt) => {
ast::ty_box(~ref mt) | ast::ty_uniq(~ref mt) | ast::ty_vec(~ref mt) |
ast::ty_rptr(_, ~ref mt) | ast::ty_ptr(~ref mt) => {
visit_mt(mt, (cx, visitor));
}

Expand Down Expand Up @@ -855,10 +855,10 @@ fn determine_rp_in_ty(ty: &ast::Ty,
// mutability is invariant
if mt.mutbl == ast::m_mutbl {
do cx.with_ambient_variance(rv_invariant) {
(visitor.visit_ty)(mt.ty, (cx, visitor));
(visitor.visit_ty)(&mt.ty, (cx, visitor));
}
} else {
(visitor.visit_ty)(mt.ty, (cx, visitor));
(visitor.visit_ty)(&mt.ty, (cx, visitor));
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ impl Resolver {
// Create the module and add all methods.
match ty {
&Ty {
node: ty_path(ref path, _, _),
node: ty_path(~ref path, _, _),
_
} if path.idents.len() == 1 => {
let name = path_to_ident(path);
Expand Down Expand Up @@ -3640,7 +3640,7 @@ impl Resolver {
}
}

item_fn(ref fn_decl, _, _, ref generics, ref block) => {
item_fn(~ref fn_decl, _, _, ref generics, ref block) => {
self.resolve_function(OpaqueFunctionRibKind,
Some(fn_decl),
HasTypeParameters
Expand Down Expand Up @@ -3811,7 +3811,7 @@ impl Resolver {
type_parameter_bound: &TyParamBound,
visitor: ResolveVisitor) {
match *type_parameter_bound {
TraitTyParamBound(ref tref) => {
TraitTyParamBound(~ref tref) => {
self.resolve_trait_reference(tref, visitor, TraitBoundingTypeParameter)
}
RegionTyParamBound => {}
Expand Down Expand Up @@ -4117,7 +4117,7 @@ impl Resolver {
// Like path expressions, the interpretation of path types depends
// on whether the path has multiple elements in it or not.

ty_path(ref path, ref bounds, path_id) => {
ty_path(~ref path, ref bounds, path_id) => {
// This is a path in the type namespace. Walk through scopes
// scopes looking for it.
let mut result_def = None;
Expand Down Expand Up @@ -4916,7 +4916,7 @@ impl Resolver {
// The interpretation of paths depends on whether the path has
// multiple elements in it or not.

expr_path(ref path) => {
expr_path(~ref path) => {
// This is a local path in the value namespace. Walk through
// scopes looking for it.

Expand Down Expand Up @@ -4976,7 +4976,7 @@ impl Resolver {
visit_expr(expr, ((), visitor));
}

expr_fn_block(ref fn_decl, ref block) => {
expr_fn_block(~ref fn_decl, ref block) => {
self.resolve_function(FunctionRibKind(expr.id, block.node.id),
Some(fn_decl),
NoTypeParameters,
Expand All @@ -4985,7 +4985,7 @@ impl Resolver {
visitor);
}

expr_struct(ref path, _, _) => {
expr_struct(~ref path, _, _) => {
// Resolve the path to the structure it goes to.
match self.resolve_path(path, TypeNS, false, visitor) {
Some(def_ty(class_id)) | Some(def_struct(class_id))
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2130,7 +2130,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
_ => fail!("trans_item"),
};
match item.node {
ast::item_fn(ref decl, purity, _abis, ref generics, ref body) => {
ast::item_fn(~ref decl, purity, _abis, ref generics, ref body) => {
if purity == ast::extern_fn {
let llfndecl = get_item_val(ccx, item.id);
foreign::trans_foreign_fn(ccx,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ pub fn trans_arg_expr(bcx: block,
match arg_expr.node {
ast::expr_loop_body(
blk @ @ast::expr {
node: ast::expr_fn_block(ref decl, ref body),
node: ast::expr_fn_block(~ref decl, ref body),
_
}) => {
let scratch_ty = expr_ty(bcx, arg_expr);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ pub fn create_function(fcx: fn_ctxt) -> DISubprogram {
let (ident, ret_ty, id) = match fnitem {
ast_map::node_item(ref item, _) => {
match item.node {
ast::item_fn(ast::fn_decl { output: ref ty, _}, _, _, _, _) => {
ast::item_fn(~ast::fn_decl { output: ref ty, _}, _, _, _, _) => {
(item.ident, ty, item.id)
}
_ => fcx.ccx.sess.span_bug(item.span, "create_function: item bound to non-function")
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
ast::expr_vec(*) | ast::expr_repeat(*) => {
return tvec::trans_fixed_vstore(bcx, expr, expr, dest);
}
ast::expr_fn_block(ref decl, ref body) => {
ast::expr_fn_block(~ref decl, ref body) => {
let expr_ty = expr_ty(bcx, expr);
let sigil = ty::ty_closure_sigil(expr_ty);
debug!("translating fn_block %s with type %s",
Expand All @@ -616,7 +616,7 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
let expr_ty = expr_ty(bcx, expr);
let sigil = ty::ty_closure_sigil(expr_ty);
match blk.node {
ast::expr_fn_block(ref decl, ref body) => {
ast::expr_fn_block(~ref decl, ref body) => {
return closure::trans_expr_fn(bcx,
sigil,
decl,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/monomorphize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,

let lldecl = match map_node {
ast_map::node_item(i@@ast::item {
node: ast::item_fn(ref decl, _, _, _, ref body),
node: ast::item_fn(~ref decl, _, _, _, ref body),
_
}, _) => {
let d = mk_lldecl();
Expand Down
20 changes: 10 additions & 10 deletions src/librustc/middle/typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
fn ast_mt_to_mt<AC:AstConv, RS:region_scope + Copy + 'static>(
this: &AC, rscope: &RS, mt: &ast::mt) -> ty::mt {

ty::mt {ty: ast_ty_to_ty(this, rscope, mt.ty), mutbl: mt.mutbl}
ty::mt {ty: ast_ty_to_ty(this, rscope, &mt.ty), mutbl: mt.mutbl}
}

// Handle @, ~, and & being able to mean estrs and evecs.
Expand All @@ -268,15 +268,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
let tcx = this.tcx();

match a_seq_ty.ty.node {
ast::ty_vec(ref mt) => {
ast::ty_vec(~ref mt) => {
let mut mt = ast_mt_to_mt(this, rscope, mt);
if a_seq_ty.mutbl == ast::m_mutbl ||
a_seq_ty.mutbl == ast::m_const {
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
}
return ty::mk_evec(tcx, mt, vst);
}
ast::ty_path(ref path, ref bounds, id) => {
ast::ty_path(~ref path, ref bounds, id) => {
// Note that the "bounds must be empty if path is not a trait"
// restriction is enforced in the below case for ty_path, which
// will run after this as long as the path isn't a trait.
Expand Down Expand Up @@ -355,23 +355,23 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
let typ = match ast_ty.node {
ast::ty_nil => ty::mk_nil(),
ast::ty_bot => ty::mk_bot(),
ast::ty_box(ref mt) => {
ast::ty_box(~ref mt) => {
mk_pointer(this, rscope, mt, ty::vstore_box,
|tmt| ty::mk_box(tcx, tmt))
}
ast::ty_uniq(ref mt) => {
ast::ty_uniq(~ref mt) => {
mk_pointer(this, rscope, mt, ty::vstore_uniq,
|tmt| ty::mk_uniq(tcx, tmt))
}
ast::ty_vec(ref mt) => {
ast::ty_vec(~ref mt) => {
tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type");
// return /something/ so they can at least get more errors
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, mt), ty::vstore_uniq)
}
ast::ty_ptr(ref mt) => {
ast::ty_ptr(~ref mt) => {
ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt))
}
ast::ty_rptr(ref region, ref mt) => {
ast::ty_rptr(ref region, ~ref mt) => {
let r = ast_region_to_region(this, rscope, ast_ty.span, region);
mk_pointer(this, rscope, mt, ty::vstore_slice(r),
|tmt| ty::mk_rptr(tcx, r, tmt))
Expand Down Expand Up @@ -405,7 +405,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
ast_ty.span);
ty::mk_closure(tcx, fn_decl)
}
ast::ty_path(ref path, ref bounds, id) => {
ast::ty_path(~ref path, ref bounds, id) => {
let a_def = match tcx.def_map.find(&id) {
None => tcx.sess.span_fatal(
ast_ty.span, fmt!("unbound path %s",
Expand Down Expand Up @@ -478,7 +478,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
}
}
}
ast::ty_fixed_length_vec(ref a_mt, e) => {
ast::ty_fixed_length_vec(~ref a_mt, e) => {
match const_eval::eval_const_expr_partial(tcx, e) {
Ok(ref r) => {
match *r {
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/middle/typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) {
enum_definition.variants,
it.id);
}
ast::item_fn(ref decl, _, _, _, ref body) => {
ast::item_fn(~ref decl, _, _, _, ref body) => {
check_bare_fn(ccx, decl, body, it.id, None);
}
ast::item_impl(_, _, _, ref ms) => {
Expand Down Expand Up @@ -2171,7 +2171,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
};

match loop_body.node {
ast::expr_fn_block(ref decl, ref body) => {
ast::expr_fn_block(~ref decl, ref body) => {
// If an error occurred, we pretend this isn't a for
// loop, so as to assign types to all nodes while also
// propagating ty_err throughout so as to suppress
Expand Down Expand Up @@ -2436,7 +2436,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
};
fcx.write_ty(id, oprnd_t);
}
ast::expr_path(ref pth) => {
ast::expr_path(~ref pth) => {
let defn = lookup_def(fcx, pth.span, id);

let tpt = ty_param_bounds_and_ty_for_def(fcx, expr.span, defn);
Expand Down Expand Up @@ -2546,7 +2546,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
ast::expr_match(discrim, ref arms) => {
_match::check_match(fcx, expr, discrim, *arms);
}
ast::expr_fn_block(ref decl, ref body) => {
ast::expr_fn_block(~ref decl, ref body) => {
check_expr_fn(fcx, expr, None,
decl, body, Vanilla, expected);
}
Expand Down Expand Up @@ -2576,7 +2576,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
}
};
match b.node {
ast::expr_fn_block(ref decl, ref body) => {
ast::expr_fn_block(~ref decl, ref body) => {
check_expr_fn(fcx, b, None,
decl, body, DoBlock, Some(inner_ty));
demand::suptype(fcx, b.span, inner_ty, fcx.expr_ty(b));
Expand Down Expand Up @@ -2621,7 +2621,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
fcx.write_bot(id);
}
}
ast::expr_cast(e, ref t) => {
ast::expr_cast(e, ~ref t) => {
check_expr(fcx, e);
let t_1 = fcx.to_ty(t);
let t_e = fcx.expr_ty(e);
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,13 +1031,13 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::item)
}
let rp = tcx.region_paramd_items.find(&it.id).map_consume(|x| *x);
match it.node {
ast::item_static(ref t, _, _) => {
ast::item_static(~ref t, _, _) => {
let typ = ccx.to_ty(&empty_rscope, t);
let tpt = no_params(typ);
tcx.tcache.insert(local_def(it.id), tpt);
return tpt;
}
ast::item_fn(ref decl, purity, _, ref generics, _) => {
ast::item_fn(~ref decl, purity, _, ref generics, _) => {
assert!(rp.is_none());
let ty_generics = ty_generics(ccx, None, generics, 0);
let tofd = astconv::ty_of_bare_fn(ccx,
Expand Down Expand Up @@ -1184,7 +1184,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
};
for ast_bounds.iter().advance |ast_bound| {
match *ast_bound {
TraitTyParamBound(ref b) => {
TraitTyParamBound(~ref b) => {
let ty = ty::mk_param(ccx.tcx, param_ty.idx, param_ty.def_id);
let trait_ref = instantiate_trait_ref(ccx, b, rp, generics, ty);
if !astconv::try_add_builtin_trait(
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/tystr_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn get_fn_sig(srv: astsrv::Srv, fn_id: doc::AstId) -> Option<~str> {
match ctxt.ast_map.get_copy(&fn_id) {
ast_map::node_item(@ast::item {
ident: ident,
node: ast::item_fn(ref decl, purity, _, ref tys, _), _
node: ast::item_fn(~ref decl, purity, _, ref tys, _), _
}, _) |
ast_map::node_foreign_item(@ast::foreign_item {
ident: ident,
Expand All @@ -94,7 +94,7 @@ fn fold_const(
do astsrv::exec(srv) |ctxt| {
match ctxt.ast_map.get_copy(&doc.id()) {
ast_map::node_item(@ast::item {
node: ast::item_static(ref ty, _, _), _
node: ast::item_static(~ref ty, _, _), _
}, _) => {
pprust::ty_to_str(ty, extract::interner())
}
Expand Down
Loading