about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-12-19 01:16:53 -0800
committerdianne <diannes.gm@gmail.com>2025-01-06 16:12:11 -0800
commit50222dba2edd2bcf265a8ca4753de0df59bf587d (patch)
tree80fbafb856e71cb4bf733562ade3931efebb3e62 /compiler/rustc_middle
parent31e4d8175a3ef5d10f2319e98a20ca6c81614487 (diff)
downloadrust-50222dba2edd2bcf265a8ca4753de0df59bf587d.tar.gz
rust-50222dba2edd2bcf265a8ca4753de0df59bf587d.zip
`best_blame_constraint`: avoid blaming assignments without user-provided types
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/mir/query.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs
index 429be9bc725..c2bb95a91c4 100644
--- a/compiler/rustc_middle/src/mir/query.rs
+++ b/compiler/rustc_middle/src/mir/query.rs
@@ -250,7 +250,12 @@ pub enum ConstraintCategory<'tcx> {
     CallArgument(#[derive_where(skip)] Option<Ty<'tcx>>),
     CopyBound,
     SizedBound,
-    Assignment,
+    Assignment {
+        /// Whether this assignment is likely to be interesting to refer to in diagnostics.
+        /// Currently, this is true when it's assigning to a projection, when it's assigning from
+        /// the return value of a call, and when it has a user-provided type annotation.
+        has_interesting_ty: bool,
+    },
     /// A constraint that came from a usage of a variable (e.g. in an ADT expression
     /// like `Foo { field: my_val }`)
     Usage,