]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_middle/query/mod.rs
Helper method for whether type has structural equality
[rust.git] / src / librustc_middle / query / mod.rs
index 4d7e7882e426c48b48945bf4b2d0c11ddf3e4e17..be15e6c576f69379f628818b89adda626770167b 100644 (file)
@@ -789,6 +789,17 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
             desc { "computing whether `{}` needs drop", env.value }
         }
 
+        /// Query backing `TyS::is_structural_eq_shallow`.
+        ///
+        /// This is only correct for ADTs. Call `is_structural_eq_shallow` to handle all types
+        /// correctly.
+        query has_structural_eq_impls(ty: Ty<'tcx>) -> bool {
+            desc {
+                "computing whether `{:?}` implements `PartialStructuralEq` and `StructuralEq`",
+                ty
+            }
+        }
+
         /// A list of types where the ADT requires drop if and only if any of
         /// those types require drop. If the ADT is known to always need drop
         /// then `Err(AlwaysRequiresDrop)` is returned.