allow inference vars in type_implements_trait

This commit is contained in:
Niko Matsakis 2021-07-04 11:26:32 -04:00
parent 26f7030b16
commit 40ee019c17
9 changed files with 118 additions and 46 deletions

View file

@ -1559,9 +1559,22 @@ rustc_queries! {
desc { "evaluating trait selection obligation `{}`", goal.value }
}
/// Evaluates whether the given type implements the given trait
/// in the given environment.
///
/// The inputs are:
///
/// - the def-id of the trait
/// - the self type
/// - the *other* type parameters of the trait, excluding the self-type
/// - the parameter environment
///
/// FIXME. If the type, trait, or environment has inference variables,
/// this yields `EvaluatedToUnknown`. It should be refactored
/// to use canonicalization, really.
query type_implements_trait(
key: (DefId, Ty<'tcx>, SubstsRef<'tcx>, ty::ParamEnv<'tcx>, )
) -> bool {
) -> traits::EvaluationResult {
desc { "evaluating `type_implements_trait` `{:?}`", key }
}