Skip to content

Commit 09589aa

Browse files
committed
librustc: De-@mut FnCtxt.
1 parent c943232 commit 09589aa

File tree

7 files changed

+104
-102
lines changed

7 files changed

+104
-102
lines changed

src/librustc/middle/typeck/check/_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::parse::token;
2525
use syntax::codemap::Span;
2626
use syntax::print::pprust;
2727

28-
pub fn check_match(fcx: @mut FnCtxt,
28+
pub fn check_match(fcx: @FnCtxt,
2929
expr: @ast::Expr,
3030
discrim: @ast::Expr,
3131
arms: &[ast::Arm]) {
@@ -102,7 +102,7 @@ pub fn check_match(fcx: @mut FnCtxt,
102102
}
103103

104104
pub struct pat_ctxt {
105-
fcx: @mut FnCtxt,
105+
fcx: @FnCtxt,
106106
map: PatIdMap,
107107
}
108108

src/librustc/middle/typeck/check/demand.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ use syntax::codemap::Span;
2020

2121
// Requires that the two types unify, and prints an error message if they
2222
// don't.
23-
pub fn suptype(fcx: @mut FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
23+
pub fn suptype(fcx: @FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
2424
suptype_with_fn(fcx, sp, false, expected, actual,
2525
|sp, e, a, s| { fcx.report_mismatched_types(sp, e, a, s) })
2626
}
2727

28-
pub fn subtype(fcx: @mut FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
28+
pub fn subtype(fcx: @FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
2929
suptype_with_fn(fcx, sp, true, actual, expected,
3030
|sp, a, e, s| { fcx.report_mismatched_types(sp, e, a, s) })
3131
}
3232

33-
pub fn suptype_with_fn(fcx: @mut FnCtxt,
33+
pub fn suptype_with_fn(fcx: @FnCtxt,
3434
sp: Span,
3535
b_is_expected: bool,
3636
ty_a: ty::t,
@@ -46,7 +46,7 @@ pub fn suptype_with_fn(fcx: @mut FnCtxt,
4646
}
4747
}
4848

49-
pub fn eqtype(fcx: @mut FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
49+
pub fn eqtype(fcx: @FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
5050
match infer::mk_eqty(fcx.infcx(), false, infer::Misc(sp), actual, expected) {
5151
Ok(()) => { /* ok */ }
5252
Err(ref err) => {
@@ -56,10 +56,7 @@ pub fn eqtype(fcx: @mut FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
5656
}
5757

5858
// Checks that the type `actual` can be coerced to `expected`.
59-
pub fn coerce(fcx: @mut FnCtxt,
60-
sp: Span,
61-
expected: ty::t,
62-
expr: @ast::Expr) {
59+
pub fn coerce(fcx: @FnCtxt, sp: Span, expected: ty::t, expr: @ast::Expr) {
6360
let expr_ty = fcx.expr_ty(expr);
6461
match fcx.mk_assignty(expr, expr_ty, expected) {
6562
result::Ok(()) => { /* ok */ }

src/librustc/middle/typeck/check/method.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub enum AutoderefReceiverFlag {
118118
}
119119

120120
pub fn lookup(
121-
fcx: @mut FnCtxt,
121+
fcx: @FnCtxt,
122122

123123
// In a call `a.b::<X, Y, ...>(...)`:
124124
expr: @ast::Expr, // The expression `a.b(...)`.
@@ -168,7 +168,7 @@ pub fn lookup(
168168
}
169169

170170
pub struct LookupContext<'a> {
171-
fcx: @mut FnCtxt,
171+
fcx: @FnCtxt,
172172
expr: @ast::Expr,
173173
self_expr: @ast::Expr,
174174
callee_id: NodeId,
@@ -1245,7 +1245,7 @@ impl<'a> LookupContext<'a> {
12451245
}
12461246
}
12471247

1248-
fn rcvr_matches_ty(fcx: @mut FnCtxt,
1248+
fn rcvr_matches_ty(fcx: @FnCtxt,
12491249
rcvr_ty: ty::t,
12501250
candidate: &Candidate) -> bool {
12511251
match candidate.rcvr_match_condition {

0 commit comments

Comments
 (0)