From 169113935f0f0bdedaa94730f3f1eee16e254ff0 Mon Sep 17 00:00:00 2001 From: John Kugelman Date: Sun, 10 Oct 2021 00:44:34 -0400 Subject: [PATCH] Fix spelling: Cannonical -> Canonical --- compiler/rustc_middle/src/traits/select.rs | 4 ++-- .../src/traits/query/evaluate_obligation.rs | 4 ++-- .../src/traits/select/candidate_assembly.rs | 2 +- compiler/rustc_trait_selection/src/traits/select/mod.rs | 4 ++-- src/librustdoc/clean/blanket_impl.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs index 87495a2d5b3..6720493cd3c 100644 --- a/compiler/rustc_middle/src/traits/select.rs +++ b/compiler/rustc_middle/src/traits/select.rs @@ -264,14 +264,14 @@ impl EvaluationResult { /// Indicates that trait evaluation caused overflow and in which pass. #[derive(Copy, Clone, Debug, PartialEq, Eq, HashStable)] pub enum OverflowError { - Cannonical, + Canonical, ErrorReporting, } impl<'tcx> From for SelectionError<'tcx> { fn from(overflow_error: OverflowError) -> SelectionError<'tcx> { match overflow_error { - OverflowError::Cannonical => SelectionError::Overflow, + OverflowError::Canonical => SelectionError::Overflow, OverflowError::ErrorReporting => SelectionError::ErrorReporting, } } diff --git a/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs b/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs index 31254a0534d..2fa6c0c0259 100644 --- a/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs +++ b/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs @@ -83,10 +83,10 @@ impl<'cx, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'cx, 'tcx> { ) -> EvaluationResult { match self.evaluate_obligation(obligation) { Ok(result) => result, - Err(OverflowError::Cannonical) => { + Err(OverflowError::Canonical) => { let mut selcx = SelectionContext::with_query_mode(&self, TraitQueryMode::Standard); selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r { - OverflowError::Cannonical => { + OverflowError::Canonical => { span_bug!( obligation.cause.span, "Overflow should be caught earlier in standard query mode: {:?}, {:?}", diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index d68ae079077..0f6e2e0be52 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -161,7 +161,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { Ok(Some(EvaluatedCandidate { candidate: c, evaluation: eval })) } Ok(_) => Ok(None), - Err(OverflowError::Cannonical) => Err(Overflow), + Err(OverflowError::Canonical) => Err(Overflow), Err(OverflowError::ErrorReporting) => Err(ErrorReporting), }) .flat_map(Result::transpose) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 3818e75a1de..85502a399de 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -900,7 +900,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { match self.candidate_from_obligation(stack) { Ok(Some(c)) => self.evaluate_candidate(stack, &c), Ok(None) => Ok(EvaluatedToAmbig), - Err(Overflow) => Err(OverflowError::Cannonical), + Err(Overflow) => Err(OverflowError::Canonical), Err(ErrorReporting) => Err(OverflowError::ErrorReporting), Err(..) => Ok(EvaluatedToErr), } @@ -1064,7 +1064,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { self.infcx.report_overflow_error(error_obligation, true); } TraitQueryMode::Canonical => { - return Err(OverflowError::Cannonical); + return Err(OverflowError::Canonical); } } } diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index dd0cbb1b952..843dda324da 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -78,7 +78,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { ); match infcx.evaluate_obligation(&obligation) { Ok(eval_result) if eval_result.may_apply() => {} - Err(traits::OverflowError::Cannonical) => {} + Err(traits::OverflowError::Canonical) => {} Err(traits::OverflowError::ErrorReporting) => {} _ => { return false;