提交 21592cde 编写于 作者: N Niko Matsakis

move `Debug` bounds onto `Lift`

Just for convenience.
上级 be27a5a7
......@@ -348,7 +348,6 @@ fn index(&self, value: CanonicalVar) -> &Kind<'tcx> {
impl<'gcx: 'tcx, 'tcx, T> Canonicalize<'gcx, 'tcx> for QueryResult<'tcx, T>
where
T: TypeFoldable<'tcx> + Lift<'gcx>,
T::Lifted: Debug,
{
// we ought to intern this, but I'm too lazy just now
type Canonicalized = Lrc<Canonical<'gcx, QueryResult<'gcx, T::Lifted>>>;
......
......@@ -63,7 +63,6 @@ pub fn make_canonicalized_query_result<T>(
) -> Result<CanonicalizedQueryResult<'gcx, T>, NoSolution>
where
T: Debug + Lift<'gcx> + TypeFoldable<'tcx>,
T::Lifted: Debug,
{
let query_result = self.make_query_result(inference_vars, answer, fulfill_cx)?;
let (canonical_result, _) = self.canonicalize_response(&query_result);
......
......@@ -64,6 +64,7 @@
use std::cmp::Ordering;
use std::collections::hash_map::{self, Entry};
use std::hash::{Hash, Hasher};
use std::fmt::Debug;
use std::mem;
use std::ops::Deref;
use std::iter;
......@@ -1503,8 +1504,8 @@ pub fn enter_local<F, R>(
/// contain the TypeVariants key or if the address of the interned
/// pointer differs. The latter case is possible if a primitive type,
/// e.g. `()` or `u8`, was interned in a different context.
pub trait Lift<'tcx> {
type Lifted: 'tcx;
pub trait Lift<'tcx>: Debug {
type Lifted: Debug + 'tcx;
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Option<Self::Lifted>;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册