]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/infer/at.rs
Remove ty::BrFresh and new_bound
[rust.git] / src / librustc / infer / at.rs
index 34cd3ae5427e0ff849f6456615533a396bb3f5a6..577211088929025ba2c06ac70fba2b231630dab9 100644 (file)
@@ -27,6 +27,7 @@
 
 use super::*;
 
+use crate::ty::Const;
 use crate::ty::relate::{Relate, TypeRelation};
 
 pub struct At<'a, 'gcx: 'tcx, 'tcx: 'a> {
@@ -308,6 +309,20 @@ fn to_trace(cause: &ObligationCause<'tcx>,
     }
 }
 
+impl<'tcx> ToTrace<'tcx> for &'tcx Const<'tcx> {
+    fn to_trace(cause: &ObligationCause<'tcx>,
+                a_is_expected: bool,
+                a: Self,
+                b: Self)
+                -> TypeTrace<'tcx>
+    {
+        TypeTrace {
+            cause: cause.clone(),
+            values: Consts(ExpectedFound::new(a_is_expected, a, b))
+        }
+    }
+}
+
 impl<'tcx> ToTrace<'tcx> for ty::TraitRef<'tcx> {
     fn to_trace(cause: &ObligationCause<'tcx>,
                 a_is_expected: bool,