Skip to content

Commit 869c96d

Browse files
committed
De-@ type checking contexts.
1 parent 6879916 commit 869c96d

File tree

10 files changed

+136
-133
lines changed

10 files changed

+136
-133
lines changed

src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* `AstConv` instance; in this phase, the `get_item_ty()` function
2121
* triggers a recursive call to `ty_of_item()` (note that
2222
* `ast_ty_to_ty()` will detect recursive types and report an error).
23-
* In the check phase, when the @FnCtxt is used as the `AstConv`,
23+
* In the check phase, when the FnCtxt is used as the `AstConv`,
2424
* `get_item_ty()` just looks up the item type in `tcx.tcache`.
2525
*
2626
* The `RegionScope` trait controls what happens when the user does

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

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

30-
pub fn check_match(fcx: @FnCtxt,
30+
pub fn check_match(fcx: &FnCtxt,
3131
expr: &ast::Expr,
3232
discrim: &ast::Expr,
3333
arms: &[ast::Arm]) {
@@ -104,7 +104,7 @@ pub fn check_match(fcx: @FnCtxt,
104104
}
105105

106106
pub struct pat_ctxt<'a> {
107-
fcx: @FnCtxt<'a>,
107+
fcx: &'a FnCtxt<'a>,
108108
map: PatIdMap,
109109
}
110110

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn suptype_with_fn(fcx: &FnCtxt,
4646
}
4747
}
4848

49-
pub fn eqtype(fcx: @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,7 +56,7 @@ pub fn eqtype(fcx: @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: @FnCtxt, sp: Span, expected: ty::t, expr: &ast::Expr) {
59+
pub fn coerce(fcx: &FnCtxt, sp: Span, expected: ty::t, expr: &ast::Expr) {
6060
let expr_ty = fcx.expr_ty(expr);
6161
match fcx.mk_assignty(expr, expr_ty, expected) {
6262
result::Ok(()) => { /* ok */ }

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub enum AutoderefReceiverFlag {
120120
}
121121

122122
pub fn lookup<'a>(
123-
fcx: @FnCtxt,
123+
fcx: &'a FnCtxt<'a>,
124124

125125
// In a call `a.b::<X, Y, ...>(...)`:
126126
expr: &ast::Expr, // The expression `a.b(...)`.
@@ -165,7 +165,7 @@ pub fn lookup<'a>(
165165
}
166166

167167
pub fn lookup_in_trait<'a>(
168-
fcx: @FnCtxt,
168+
fcx: &'a FnCtxt<'a>,
169169

170170
// In a call `a.b::<X, Y, ...>(...)`:
171171
span: Span, // The expression `a.b(...)`'s span.
@@ -199,7 +199,7 @@ pub fn lookup_in_trait<'a>(
199199
}
200200

201201
struct LookupContext<'a> {
202-
fcx: @FnCtxt<'a>,
202+
fcx: &'a FnCtxt<'a>,
203203
span: Span,
204204

205205
// The receiver to the method call. Only `None` in the case of
@@ -1351,7 +1351,7 @@ impl<'a> LookupContext<'a> {
13511351
}
13521352
}
13531353

1354-
fn rcvr_matches_ty(fcx: @FnCtxt,
1354+
fn rcvr_matches_ty(fcx: &FnCtxt,
13551355
rcvr_ty: ty::t,
13561356
candidate: &Candidate) -> bool {
13571357
match candidate.rcvr_match_condition {

0 commit comments

Comments
 (0)