Skip to content

Commit b88517e

Browse files
author
blake2-ppc
committed
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.
1 parent 948b5ab commit b88517e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
121121
for pat in arm.pats.iter() {
122122

123123
// Check that we do not match against a static NaN (#6804)
124-
let pat_matches_nan: &fn(@Pat) -> bool = |p| {
124+
let pat_matches_nan: &fn(&Pat) -> bool = |p| {
125125
match cx.tcx.def_map.find(&p.id) {
126126
Some(&DefStatic(did, false)) => {
127127
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
@@ -893,7 +893,7 @@ pub fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
893893
}
894894
}
895895

896-
let check_move: &fn(@Pat, Option<@Pat>) = |p, sub| {
896+
let check_move: &fn(&Pat, Option<@Pat>) = |p, sub| {
897897
// check legality of moving out of the enum
898898

899899
// x @ Foo(*) is legal, but x @ Foo(y) isn't.

src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5410,7 +5410,7 @@ impl Resolver {
54105410
}
54115411

54125412
pub fn enforce_default_binding_mode(&mut self,
5413-
pat: @Pat,
5413+
pat: &Pat,
54145414
pat_binding_mode: BindingMode,
54155415
descr: &str) {
54165416
match pat_binding_mode {

src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
24852485
ty::item_path(ccx.tcx, ast_util::local_def(*id))
24862486
}
24872487

2488-
fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
2488+
fn exported_name(ccx: &mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
24892489
match attr::first_attr_value_str_by_name(attrs, "export_name") {
24902490
// Use provided name
24912491
Some(name) => name.to_owned(),
@@ -2979,7 +2979,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
29792979
return map;
29802980
}
29812981

2982-
pub fn fill_crate_map(ccx: @mut CrateContext, map: ValueRef) {
2982+
pub fn fill_crate_map(ccx: &mut CrateContext, map: ValueRef) {
29832983
let mut subcrates: ~[ValueRef] = ~[];
29842984
let mut i = 1;
29852985
let cstore = ccx.sess.cstore;
@@ -3030,7 +3030,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
30303030
}
30313031
}
30323032

3033-
pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
3033+
pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) {
30343034
if !*cx.sess.building_library { return; }
30353035

30363036
let encode_inlined_item: encoder::encode_inlined_item =

0 commit comments

Comments
 (0)