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/src/autoderef.rs | |
| parent | 021861aea8de20c76c7411eb8ada7e8235e3d9b5 (diff) | |
| download | rust-5fc39e0796bae3aaba08be70606bbb52ccddc1d3.tar.gz rust-5fc39e0796bae3aaba08be70606bbb52ccddc1d3.zip | |
Random type checker changes
Diffstat (limited to 'compiler/rustc_hir_analysis/src/autoderef.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/autoderef.rs | 3 |
1 files changed, 3 insertions, 0 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; |
