trans: Change @ast::Pat and @mut CrateContext in a few places

Use borrowed references in a few locations that were encountered when
working on other changes.
This commit is contained in:
blake2-ppc 2013-09-30 19:37:17 +02:00
parent 948b5ab87a
commit b88517ec93
3 changed files with 6 additions and 6 deletions

View File

@ -121,7 +121,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
for pat in arm.pats.iter() { for pat in arm.pats.iter() {
// Check that we do not match against a static NaN (#6804) // Check that we do not match against a static NaN (#6804)
let pat_matches_nan: &fn(@Pat) -> bool = |p| { let pat_matches_nan: &fn(&Pat) -> bool = |p| {
match cx.tcx.def_map.find(&p.id) { match cx.tcx.def_map.find(&p.id) {
Some(&DefStatic(did, false)) => { Some(&DefStatic(did, false)) => {
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap(); let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
@ -893,7 +893,7 @@ pub fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
} }
} }
let check_move: &fn(@Pat, Option<@Pat>) = |p, sub| { let check_move: &fn(&Pat, Option<@Pat>) = |p, sub| {
// check legality of moving out of the enum // check legality of moving out of the enum
// x @ Foo(*) is legal, but x @ Foo(y) isn't. // x @ Foo(*) is legal, but x @ Foo(y) isn't.

View File

@ -5410,7 +5410,7 @@ impl Resolver {
} }
pub fn enforce_default_binding_mode(&mut self, pub fn enforce_default_binding_mode(&mut self,
pat: @Pat, pat: &Pat,
pat_binding_mode: BindingMode, pat_binding_mode: BindingMode,
descr: &str) { descr: &str) {
match pat_binding_mode { match pat_binding_mode {

View File

@ -2485,7 +2485,7 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
ty::item_path(ccx.tcx, ast_util::local_def(*id)) ty::item_path(ccx.tcx, ast_util::local_def(*id))
} }
fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str { fn exported_name(ccx: &mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
match attr::first_attr_value_str_by_name(attrs, "export_name") { match attr::first_attr_value_str_by_name(attrs, "export_name") {
// Use provided name // Use provided name
Some(name) => name.to_owned(), Some(name) => name.to_owned(),
@ -2979,7 +2979,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
return map; return map;
} }
pub fn fill_crate_map(ccx: @mut CrateContext, map: ValueRef) { pub fn fill_crate_map(ccx: &mut CrateContext, map: ValueRef) {
let mut subcrates: ~[ValueRef] = ~[]; let mut subcrates: ~[ValueRef] = ~[];
let mut i = 1; let mut i = 1;
let cstore = ccx.sess.cstore; let cstore = ccx.sess.cstore;
@ -3030,7 +3030,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
} }
} }
pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) { pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) {
if !*cx.sess.building_library { return; } if !*cx.sess.building_library { return; }
let encode_inlined_item: encoder::encode_inlined_item = let encode_inlined_item: encoder::encode_inlined_item =