diff options
| author | Michael Goulet <michael@errs.io> | 2024-01-23 15:10:23 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-01-23 15:10:23 +0000 | 
| commit | 5fc39e0796bae3aaba08be70606bbb52ccddc1d3 (patch) | |
| tree | d05dfcd71a5ad73d04f42c0e160c9e24e1ba5c4a /compiler/rustc_hir_analysis | |
| parent | 021861aea8de20c76c7411eb8ada7e8235e3d9b5 (diff) | |
| download | rust-5fc39e0796bae3aaba08be70606bbb52ccddc1d3.tar.gz rust-5fc39e0796bae3aaba08be70606bbb52ccddc1d3.zip | |
Random type checker changes
Diffstat (limited to 'compiler/rustc_hir_analysis')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/autoderef.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/compare_impl_item.rs | 2 | 
2 files changed, 4 insertions, 1 deletions
| diff --git a/compiler/rustc_hir_analysis/src/autoderef.rs b/compiler/rustc_hir_analysis/src/autoderef.rs index 556560945e9..5bc904e5930 100644 --- a/compiler/rustc_hir_analysis/src/autoderef.rs +++ b/compiler/rustc_hir_analysis/src/autoderef.rs @@ -12,7 +12,9 @@ use rustc_trait_selection::traits::StructurallyNormalizeExt; #[derive(Copy, Clone, Debug)] pub enum AutoderefKind { + /// A true pointer type, such as `&T` and `*mut T`. Builtin, + /// A type which must dispatch to a `Deref` implementation. Overloaded, } @@ -83,6 +85,7 @@ impl<'a, 'tcx> Iterator for Autoderef<'a, 'tcx> { (AutoderefKind::Builtin, ty) } } else if let Some(ty) = self.overloaded_deref_ty(self.state.cur_ty) { + // The overloaded deref check already normalizes the pointee type. (AutoderefKind::Overloaded, ty) } else { return None; diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs index 5b264f6f034..57829d9d418 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs @@ -254,7 +254,7 @@ fn compare_method_predicate_entailment<'tcx>( // checks. For the comparison to be valid, we need to // normalize the associated types in the impl/trait methods // first. However, because function types bind regions, just - // calling `normalize_associated_types_in` would have no effect on + // calling `FnCtxt::normalize` would have no effect on // any associated types appearing in the fn arguments or return // type. | 
