1
Fork 0

Rollup merge of #89722 - jkugelman:cannonical-typo, r=joshtriplett

Fix spelling: Cannonical -> Canonical
This commit is contained in:
Matthias Krüger 2021-10-11 00:34:40 +02:00 committed by GitHub
commit 9d307f1ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -264,14 +264,14 @@ impl EvaluationResult {
/// Indicates that trait evaluation caused overflow and in which pass. /// Indicates that trait evaluation caused overflow and in which pass.
#[derive(Copy, Clone, Debug, PartialEq, Eq, HashStable)] #[derive(Copy, Clone, Debug, PartialEq, Eq, HashStable)]
pub enum OverflowError { pub enum OverflowError {
Cannonical, Canonical,
ErrorReporting, ErrorReporting,
} }
impl<'tcx> From<OverflowError> for SelectionError<'tcx> { impl<'tcx> From<OverflowError> for SelectionError<'tcx> {
fn from(overflow_error: OverflowError) -> SelectionError<'tcx> { fn from(overflow_error: OverflowError) -> SelectionError<'tcx> {
match overflow_error { match overflow_error {
OverflowError::Cannonical => SelectionError::Overflow, OverflowError::Canonical => SelectionError::Overflow,
OverflowError::ErrorReporting => SelectionError::ErrorReporting, OverflowError::ErrorReporting => SelectionError::ErrorReporting,
} }
} }

View file

@ -83,10 +83,10 @@ impl<'cx, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'cx, 'tcx> {
) -> EvaluationResult { ) -> EvaluationResult {
match self.evaluate_obligation(obligation) { match self.evaluate_obligation(obligation) {
Ok(result) => result, Ok(result) => result,
Err(OverflowError::Cannonical) => { Err(OverflowError::Canonical) => {
let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard); let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r { selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r {
OverflowError::Cannonical => { OverflowError::Canonical => {
span_bug!( span_bug!(
obligation.cause.span, obligation.cause.span,
"Overflow should be caught earlier in standard query mode: {:?}, {:?}", "Overflow should be caught earlier in standard query mode: {:?}, {:?}",

View file

@ -161,7 +161,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
Ok(Some(EvaluatedCandidate { candidate: c, evaluation: eval })) Ok(Some(EvaluatedCandidate { candidate: c, evaluation: eval }))
} }
Ok(_) => Ok(None), Ok(_) => Ok(None),
Err(OverflowError::Cannonical) => Err(Overflow), Err(OverflowError::Canonical) => Err(Overflow),
Err(OverflowError::ErrorReporting) => Err(ErrorReporting), Err(OverflowError::ErrorReporting) => Err(ErrorReporting),
}) })
.flat_map(Result::transpose) .flat_map(Result::transpose)

View file

@ -900,7 +900,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
match self.candidate_from_obligation(stack) { match self.candidate_from_obligation(stack) {
Ok(Some(c)) => self.evaluate_candidate(stack, &c), Ok(Some(c)) => self.evaluate_candidate(stack, &c),
Ok(None) => Ok(EvaluatedToAmbig), Ok(None) => Ok(EvaluatedToAmbig),
Err(Overflow) => Err(OverflowError::Cannonical), Err(Overflow) => Err(OverflowError::Canonical),
Err(ErrorReporting) => Err(OverflowError::ErrorReporting), Err(ErrorReporting) => Err(OverflowError::ErrorReporting),
Err(..) => Ok(EvaluatedToErr), Err(..) => Ok(EvaluatedToErr),
} }
@ -1064,7 +1064,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
self.infcx.report_overflow_error(error_obligation, true); self.infcx.report_overflow_error(error_obligation, true);
} }
TraitQueryMode::Canonical => { TraitQueryMode::Canonical => {
return Err(OverflowError::Cannonical); return Err(OverflowError::Canonical);
} }
} }
} }

View file

@ -78,7 +78,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
); );
match infcx.evaluate_obligation(&obligation) { match infcx.evaluate_obligation(&obligation) {
Ok(eval_result) if eval_result.may_apply() => {} Ok(eval_result) if eval_result.may_apply() => {}
Err(traits::OverflowError::Cannonical) => {} Err(traits::OverflowError::Canonical) => {}
Err(traits::OverflowError::ErrorReporting) => {} Err(traits::OverflowError::ErrorReporting) => {}
_ => { _ => {
return false; return false;