about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorPavel Grigorenko <GrigorenkoPV@ya.ru>2024-09-05 00:34:04 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2024-09-06 00:30:36 +0300
commitf6e8a84eeae8b5f7291999966ab82d495ea7da26 (patch)
tree00162219b0b327bcc68bf7fb0909defcebcee501 /compiler/rustc_trait_selection/src
parent842d6fc32e3d0d26bb11fbe6a2f6ae2afccc06cb (diff)
downloadrust-f6e8a84eeae8b5f7291999966ab82d495ea7da26.tar.gz
rust-f6e8a84eeae8b5f7291999966ab82d495ea7da26.zip
Make `Ty::boxed_ty` return an `Option`
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs
index bff2a184b19..65d21518491 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs
@@ -348,8 +348,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                     }
                 }
                 if let Some(ty::error::ExpectedFound { found, .. }) = exp_found
-                    && ty.is_box()
-                    && ty.boxed_ty() == found
+                    && ty.boxed_ty() == Some(found)
                     && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span)
                 {
                     err.span_suggestion(