Skip to content

Commit

Permalink
trans: Change @ast::Pat and @mut CrateContext in a few places
Browse files Browse the repository at this point in the history
Use borrowed references in a few locations that were encountered when
working on other changes.
  • Loading branch information
blake2-ppc committed Sep 30, 2013
1 parent 948b5ab commit b88517e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc/middle/check_match.rs
Expand Up @@ -121,7 +121,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
for pat in arm.pats.iter() {

// 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) {
Some(&DefStatic(did, false)) => {
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
Expand Down Expand Up @@ -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

// x @ Foo(*) is legal, but x @ Foo(y) isn't.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve.rs
Expand Up @@ -5410,7 +5410,7 @@ impl Resolver {
}

pub fn enforce_default_binding_mode(&mut self,
pat: @Pat,
pat: &Pat,
pat_binding_mode: BindingMode,
descr: &str) {
match pat_binding_mode {
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/trans/base.rs
Expand Up @@ -2485,7 +2485,7 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
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") {
// Use provided name
Some(name) => name.to_owned(),
Expand Down Expand Up @@ -2979,7 +2979,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
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 i = 1;
let cstore = ccx.sess.cstore;
Expand Down Expand Up @@ -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; }

let encode_inlined_item: encoder::encode_inlined_item =
Expand Down

0 comments on commit b88517e

Please sign in to comment.