diff options
| author | Luqman Aden <me@luqman.ca> | 2014-08-25 13:30:49 -0700 |
|---|---|---|
| committer | Luqman Aden <me@luqman.ca> | 2014-08-25 13:30:49 -0700 |
| commit | 1660c3be932ff7beff5f025a708bf3ee0ff2ebd4 (patch) | |
| tree | 1881fb5b46e68f9fbf73b9e2c04800c4614daf8b /src | |
| parent | 5fb2dfaa200f2cb32e77c54ae8a5e0f4823b65c8 (diff) | |
| download | rust-1660c3be932ff7beff5f025a708bf3ee0ff2ebd4.tar.gz rust-1660c3be932ff7beff5f025a708bf3ee0ff2ebd4.zip | |
librustc: Use Typer's node_ty method instead of free function in ExprUseVisitor.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/expr_use_visitor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 84b879227ae..0b71c35d2f8 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -234,7 +234,7 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> { decl: &ast::FnDecl, body: &ast::Block) { for arg in decl.inputs.iter() { - let arg_ty = ty::node_id_to_type(self.tcx(), arg.pat.id); + let arg_ty = return_if_err!(self.typer.node_ty(arg.pat.id)); let arg_cmt = self.mc.cat_rvalue( arg.id, @@ -414,7 +414,7 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> { // Fetch the type of the value that the iteration yields to // produce the pattern's categorized mutable type. - let pattern_type = ty::node_id_to_type(self.tcx(), pat.id); + let pattern_type = return_if_err!(self.typer.node_ty(pat.id)); let pat_cmt = self.mc.cat_rvalue(pat.id, pat.span, ty::ReScope(blk.id), @@ -828,7 +828,7 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> { pat.repr(tcx)); // pat_ty: the type of the binding being produced. - let pat_ty = ty::node_id_to_type(tcx, pat.id); + let pat_ty = return_if_err!(typer.node_ty(pat.id)); // Each match binding is effectively an assignment to the // binding being produced. @@ -971,7 +971,7 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> { // Create the cmt for the variable being borrowed, from the // caller's perspective let var_id = upvar_def.def_id().node; - let var_ty = ty::node_id_to_type(self.tcx(), var_id); + let var_ty = try!(self.typer.node_ty(var_id)); self.mc.cat_def(closure_id, closure_span, var_ty, upvar_def) } } |
