about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-31 16:42:19 +0000
committerbors <bors@rust-lang.org>2025-07-31 16:42:19 +0000
commitadcb3d3b4cd3b7c4cde642f3ed537037f293738e (patch)
tree7eb7f7e22231a798a694ad1dd78f96b88cff3ed6 /compiler/rustc_trait_selection/src
parent3fb1b53a9dbfcdf37a4b67d35cde373316829930 (diff)
parente2ae91b74aa85e0076377908f41b050bec11cda4 (diff)
downloadrust-adcb3d3b4cd3b7c4cde642f3ed537037f293738e.tar.gz
rust-adcb3d3b4cd3b7c4cde642f3ed537037f293738e.zip
Auto merge of #144740 - jdonszelmann:rollup-nprgqnm, r=jdonszelmann
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#144688 (Uniform `enter_trace_span!` and add documentation)
 - rust-lang/rust#144702 (stall `ConstArgHasType` in `compute_goal_fast_path`)
 - rust-lang/rust#144711 (Consider operator's span when computing binop expr span)
 - rust-lang/rust#144712 (Deduplicate `IntTy`/`UintTy`/`FloatTy`.)
 - rust-lang/rust#144726 (merge rustc_attr_data_structures into rustc_hir)
 - rust-lang/rust#144733 (fix: Match width of ascii and unicode secondary file start)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs3
-rw-r--r--compiler/rustc_trait_selection/src/solve/delegate.rs7
2 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs
index db35c988bf7..8e0620f2048 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs
@@ -1,8 +1,9 @@
-use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect};
 use rustc_errors::{Diag, MultiSpan, pluralize};
 use rustc_hir as hir;
+use rustc_hir::attrs::AttributeKind;
 use rustc_hir::def::DefKind;
+use rustc_hir::find_attr;
 use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
 use rustc_middle::ty::error::{ExpectedFound, TypeError};
 use rustc_middle::ty::fast_reject::DeepRejectCtxt;
diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs
index 7426504e139..1fa2a690fcb 100644
--- a/compiler/rustc_trait_selection/src/solve/delegate.rs
+++ b/compiler/rustc_trait_selection/src/solve/delegate.rs
@@ -135,6 +135,13 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
                     None
                 }
             }
+            ty::PredicateKind::Clause(ty::ClauseKind::ConstArgHasType(ct, _)) => {
+                if self.shallow_resolve_const(ct).is_ct_infer() {
+                    Some(Certainty::AMBIGUOUS)
+                } else {
+                    None
+                }
+            }
             ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
                 let arg = self.shallow_resolve_term(arg);
                 if arg.is_trivially_wf(self.tcx) {