Skip to content

Commit

Permalink
Plumb inference obligations through selection
Browse files Browse the repository at this point in the history
  • Loading branch information
soltanmm-google committed May 12, 2016
1 parent ec7c483 commit f52b655
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 66 deletions.
12 changes: 12 additions & 0 deletions src/librustc/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,18 @@ impl<'tcx, N> Vtable<'tcx, N> {
}
}

fn nested_obligations_mut(&mut self) -> &mut Vec<N> {
match self {
&mut VtableImpl(ref mut i) => &mut i.nested,
&mut VtableParam(ref mut n) => n,
&mut VtableBuiltin(ref mut i) => &mut i.nested,
&mut VtableDefaultImpl(ref mut d) => &mut d.nested,
&mut VtableClosure(ref mut c) => &mut c.nested,
&mut VtableObject(ref mut d) => &mut d.nested,
&mut VtableFnPointer(ref mut d) => &mut d.nested,
}
}

pub fn map<M, F>(self, f: F) -> Vtable<'tcx, M> where F: FnMut(N) -> M {
match self {
VtableImpl(i) => VtableImpl(VtableImplData {
Expand Down
Loading

0 comments on commit f52b655

Please sign in to comment.