fn make_query_result<T>(
        &self,
        inference_vars: CanonicalVarValues<'tcx>,
        answer: T,
        fulfill_cx: &mut FulfillmentContext<'tcx>,
    ) -> Result<QueryResult<'tcx, T>, NoSolution>
    where
        T: Debug + TypeFoldable<'tcx> + Lift<'gcx>,
    {
        let tcx = self.tcx;

        debug!(
            "make_query_result(\
             inference_vars={:?}, \
             answer={:?})",
            inference_vars, answer,
        );

        // Select everything, returning errors.
        let true_errors = match fulfill_cx.select_where_possible(self) {
            Ok(()) => vec![],
            Err(errors) => errors,
        };
        debug!("true_errors = {:#?}", true_errors);

        if !true_errors.is_empty() {
            // FIXME -- we don't indicate *why* we failed to solve
            debug!("make_query_result: true_errors={:#?}", true_errors);
            return Err(NoSolution);
        }

        // Anything left unselected *now* must be an ambiguity.
        let ambig_errors = match fulfill_cx.select_all_or_error(self) {
            Ok(()) => vec![],
            Err(errors) => errors,
        };
        debug!("ambig_errors = {:#?}", ambig_errors);

        let region_obligations = self.take_registered_region_obligations();
        let region_constraints = self.with_region_constraints(|region_constraints| {
            make_query_outlives(tcx, region_obligations, region_constraints)
        });

        let certainty = if ambig_errors.is_empty() {
            Certainty::Proven
        } else {
            Certainty::Ambiguous
        };

        Ok(QueryResult {
            var_values: inference_vars,
            region_constraints,
            certainty,
            value: answer,
        })
    }
/// Helper for `make_canonicalized_query_result` that does
/// everything up until the final canonicalization.
Helper for `make_canonicalized_query_result` that does
everything up until the final canonicalization.
Helper for ` make_canonicalized_query_result ` that does everything up until the final canonicalization .
fn make_query_result<T>(
        &self,
        inference_vars: CanonicalVarValues<'tcx>,
        answer: T,
        fulfill_cx: &mut FulfillmentContext<'tcx>,
    ) -> Result<QueryResult<'tcx, T>, NoSolution>
    where
        T: Debug + TypeFoldable<'tcx> + Lift<'gcx>,
    {
        let tcx = self.tcx;
        debug!(
            "make_query_result(\
             inference_vars={:?}, \
             answer={:?})",
            inference_vars, answer,
        );
        // Select everything, returning errors.
        let true_errors = match fulfill_cx.select_where_possible(self) {
            Ok(()) => vec![],
            Err(errors) => errors,
        };
        debug!("true_errors = {:#?}", true_errors);
        if !true_errors.is_empty() {
            // FIXME -- we don't indicate *why* we failed to solve
            debug!("make_query_result: true_errors={:#?}", true_errors);
            return Err(NoSolution);
        }
        // Anything left unselected *now* must be an ambiguity.
        let ambig_errors = match fulfill_cx.select_all_or_error(self) {
            Ok(()) => vec![],
            Err(errors) => errors,
        };
        debug!("ambig_errors = {:#?}", ambig_errors);
        let region_obligations = self.take_registered_region_obligations();
        let region_constraints = self.with_region_constraints(|region_constraints| {
            make_query_outlives(tcx, region_obligations, region_constraints)
        });
        let certainty = if ambig_errors.is_empty() {
            Certainty::Proven
        } else {
            Certainty::Ambiguous
        };
        Ok(QueryResult {
            var_values: inference_vars,
            region_constraints,
            certainty,
            value: answer,
        })
    }
fn make_query_result < T > ( & self , inference_vars : CanonicalVarValues < ' tcx > , answer : T , fulfill_cx : & mut FulfillmentContext < ' tcx > , ) -> Result < QueryResult < ' tcx , T > , NoSolution > where T : Debug + TypeFoldable < ' tcx > + Lift < ' gcx > , { let tcx = self . tcx ; debug ! ( " \
 \
 " inference_vars answer ) ; // Select everything, returning errors. let true_errors = match fulfill_cx . select_where_possible ( self ) { Ok ( ( ) ) => vec ! [ ] , Err ( errors ) => errors , } ; debug ! ( " " true_errors ) ; if ! true_errors . is_empty ( ) { // FIXME -- we don't indicate *why* we failed to solve debug ! ( " " true_errors ) ; return Err ( NoSolution ) ; } // Anything left unselected *now* must be an ambiguity. let ambig_errors = match fulfill_cx . select_all_or_error ( self ) { Ok ( ( ) ) => vec ! [ ] , Err ( errors ) => errors , } ; debug ! ( " " ambig_errors ) ; let region_obligations = self . take_registered_region_obligations ( ) ; let region_constraints = self . with_region_constraints ( | region_constraints | { make_query_outlives ( tcx , region_obligations , region_constraints ) } ) ; let certainty = if ambig_errors . is_empty ( ) { Certainty :: Proven } else { Certainty :: Ambiguous } ; Ok ( QueryResult { var_values : inference_vars , region_constraints , certainty , value : answer , } ) }
Helper for `make_canonicalized_query_result` that does
everything up until the final canonicalization.
Helper for ` make_canonicalized_query_result ` that does everything up until the final canonicalization .
&self
inference_vars
CanonicalVarValues<'tcx>
answer
T
fulfill_cx
&mut FulfillmentContext<'tcx>