File tree 1 file changed +6
-11
lines changed
src/librustc/infer/nll_relate
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -762,23 +762,18 @@ where
762
762
drop ( variables) ;
763
763
self . relate ( & u, & u)
764
764
}
765
- TypeVariableValue :: Unknown { universe } => {
766
- if self . universe . cannot_name ( universe) {
767
- debug ! (
768
- "TypeGeneralizer::tys: root universe {:?} cannot name\
769
- variable in universe {:?}",
770
- self . universe,
771
- universe
772
- ) ;
773
- return Err ( TypeError :: Mismatch ) ;
774
- }
775
-
765
+ TypeVariableValue :: Unknown { universe : _universe } => {
776
766
if self . ambient_variance == ty:: Bivariant {
777
767
// FIXME: we may need a WF predicate (related to #54105).
778
768
}
779
769
780
770
let origin = * variables. var_origin ( vid) ;
771
+
772
+ // Replacing with a new variable in the universe `self.universe`,
773
+ // it will be unified later with the original type variable in
774
+ // the universe `_universe`.
781
775
let new_var_id = variables. new_var ( self . universe , false , origin) ;
776
+
782
777
let u = self . tcx ( ) . mk_var ( new_var_id) ;
783
778
debug ! (
784
779
"generalize: replacing original vid={:?} with new={:?}" ,
You can’t perform that action at this time.
0 commit comments