// Reset ambient variance to contravariance. See the
// covariant case above for an explanation.
- let variance = ::std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
+ let variance = ::std::mem::replace(
+ &mut self.ambient_variance,
+ ty::Variance::Contravariant,
+ );
self.relate(a.skip_binder(), b.skip_binder())?;
/// so that the resulting generalized type is independent from the
/// scopes.
///
-/// [blog post]: http://smallcultfollowing.com/babysteps/blog/2014/07/09/an-experimental-new-type-inference-scheme-for-rust/
+/// [blog post]: https://is.gd/0hKvIr
struct TypeGeneralizer<'me, 'bccx: 'me, 'gcx: 'tcx, 'tcx: 'bccx> {
type_rel: &'me TypeRelating<'me, 'bccx, 'gcx, 'tcx>,
-> Option<Vec<Constructor<'tcx>>>
{
match *pat.kind {
- PatternKind::AscribeUserType { ref subpattern, .. } => pat_constructors(cx, subpattern, pcx),
+ PatternKind::AscribeUserType { ref subpattern, .. } =>
+ pat_constructors(cx, subpattern, pcx),
PatternKind::Binding { .. } | PatternKind::Wild => None,
PatternKind::Leaf { .. } | PatternKind::Deref { .. } => Some(vec![Single]),
PatternKind::Variant { adt_def, variant_index, .. } => {