use middle::ty::{self, Ty};
use middle::ty_fold::{TypeFolder, TypeFoldable};
use std::cell::{RefCell};
+ use std::fmt;
use std::rc::Rc;
use syntax::ast;
use syntax::codemap;
EquatePredicate(Span),
}
+ impl TypeOrigin {
+ fn as_str(&self) -> &'static str {
+ match self {
+ &TypeOrigin::Misc(_) |
+ &TypeOrigin::RelateSelfType(_) |
+ &TypeOrigin::RelateOutputImplTypes(_) |
+ &TypeOrigin::ExprAssignable(_) => "mismatched types",
+ &TypeOrigin::RelateTraitRefs(_) => "mismatched traits",
+ &TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait",
+ &TypeOrigin::MatchExpressionArm(_, _) => "match arms have incompatible types",
+ &TypeOrigin::IfExpression(_) => "if and else have incompatible types",
+ &TypeOrigin::IfExpressionWithNoElse(_) => "if may be missing an else clause",
+ &TypeOrigin::RangeExpression(_) => "start and end of range have incompatible types",
+ &TypeOrigin::EquatePredicate(_) => "equality predicate not satisfied",
+ }
+ }
+ }
+
+ impl fmt::Display for TypeOrigin {
+ fn fmt(&self, f: &mut fmt::Formatter) -> Result<(),fmt::Error> {
+ fmt::Display::fmt(self.as_str(), f)
+ }
+ }
+
/// See `error_reporting.rs` for more details
#[derive(Clone, Debug)]
pub enum ValuePairs<'tcx> {
})
}
+ pub fn construct_skolemized_subst(&self,
+ generics: &ty::Generics<'tcx>,
+ snapshot: &CombinedSnapshot)
+ -> (subst::Substs<'tcx>, SkolemizationMap) {
+ /*! See `higher_ranked::construct_skolemized_subst` */
+
+ higher_ranked::construct_skolemized_substs(self, generics, snapshot)
+ }
+
pub fn skolemize_late_bound_regions<T>(&self,
value: &ty::Binder<T>,
snapshot: &CombinedSnapshot)