mozilla/rust — pull request #13261 by pnkfelix (2014-04-02 12:10:44+00:00)
Title: Cannot infer variance for generics that occur in non-variance contexts

Fix #12856.

I still need to add a regression test. I will snag one off of #12856.

I wanted to put this up first because I wanted to get feedback about the second commit in the series, commit 8599236. Its the more invasive part of the patch and is largely just belt-and-suspenders assertion checking; in the commit message I mentioned at least one other approach we could take here. Or we could drop the belt-and-suspenders and just rely on the guard added in the first patch, commit 8d6a005 (which is really quite trivial on its own).

So any feedback on what would be better is appreciated.

(I'll push another commit with a regression test shortly.)

r? @nikomatsakis