Skip to content

Instantly share code, notes, and snippets.

@zwarich
Created July 18, 2014 07:44
Show Gist options
  • Save zwarich/8d67756efd985fa9b216 to your computer and use it in GitHub Desktop.
Save zwarich/8d67756efd985fa9b216 to your computer and use it in GitHub Desktop.
diff --git a/src/librustc/middle/typeck/variance.rs b/src/librustc/middle/typeck/variance.rs
index a65aa04..9c1a607 100644
--- a/src/librustc/middle/typeck/variance.rs
+++ b/src/librustc/middle/typeck/variance.rs
@@ -1008,7 +1008,10 @@ impl<'a> SolveContext<'a> {
while index < num_inferred &&
inferred_infos.get(index).item_id == item_id {
let info = inferred_infos.get(index);
- let variance = *solutions.get(index);
+ let variance = match *solutions.get(index) {
+ ty::Covariant => ty::Invariant,
+ v @ _ => v,
+ };
debug!("Index {} Info {} / {} / {} Variance {}",
index, info.index, info.kind, info.space, variance);
match info.kind {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment