Convert delegate to use an object type and remove FIXME from closed issue

This commit is contained in:
Niko Matsakis 2014-04-24 06:17:58 -04:00
parent 96dfed2b62
commit d8a34e7d3f

View File

@ -104,10 +104,10 @@ pub trait Delegate {
// supplies types from the tree. After type checking is complete, you // supplies types from the tree. After type checking is complete, you
// can just use the tcx as the typer. // can just use the tcx as the typer.
pub struct ExprUseVisitor<'d,'t,D,TYPER> { pub struct ExprUseVisitor<'d,'t,TYPER> {
typer: &'t TYPER, typer: &'t TYPER,
mc: mc::MemCategorizationContext<'t,TYPER>, mc: mc::MemCategorizationContext<'t,TYPER>,
delegate: &'d mut D, delegate: &'d mut Delegate,
} }
// If the TYPER results in an error, it's because the type check // If the TYPER results in an error, it's because the type check
@ -126,10 +126,10 @@ macro_rules! ignore_err(
) )
) )
impl<'d,'t,D:Delegate,TYPER:mc::Typer> ExprUseVisitor<'d,'t,D,TYPER> { impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> {
pub fn new(delegate: &'d mut D, pub fn new(delegate: &'d mut Delegate,
typer: &'t TYPER) typer: &'t TYPER)
-> ExprUseVisitor<'d,'t,D,TYPER> { -> ExprUseVisitor<'d,'t,TYPER> {
ExprUseVisitor { typer: typer, ExprUseVisitor { typer: typer,
mc: mc::MemCategorizationContext::new(typer), mc: mc::MemCategorizationContext::new(typer),
delegate: delegate } delegate: delegate }
@ -370,13 +370,10 @@ impl<'d,'t,D:Delegate,TYPER:mc::Typer> ExprUseVisitor<'d,'t,D,TYPER> {
} }
ast::ExprAssignOp(_, lhs, rhs) => { ast::ExprAssignOp(_, lhs, rhs) => {
// FIXME(#4712) --- Overloaded operators? // This will have to change if/when we support
// // overloaded operators for `+=` and so forth.
// if !self.walk_overloaded_operator(expr, [lhs, rhs])
// {
self.mutate_expr(expr, lhs, WriteAndRead); self.mutate_expr(expr, lhs, WriteAndRead);
self.consume_expr(rhs); self.consume_expr(rhs);
// }
} }
ast::ExprRepeat(base, count) => { ast::ExprRepeat(base, count) => {