Skip to content

Commit 551374d

Browse files
authored
Unrolled build for rust-lang#124415
Rollup merge of rust-lang#124415 - compiler-errors:candidates, r=lcnr Use probes more aggressively in new solver ....so that we have the right candidate information when assembling trait and normalizes-to goals. Also gets rid of misc probes. r? lcnr
2 parents e27af29 + 2eb7c81 commit 551374d

File tree

11 files changed

+394
-375
lines changed

11 files changed

+394
-375
lines changed

compiler/rustc_middle/src/traits/solve.rs

+5
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,9 @@ pub enum CandidateSource {
332332
/// }
333333
/// ```
334334
AliasBound,
335+
/// A candidate that is registered only during coherence to represent some
336+
/// yet-unknown impl that could be produced downstream without violating orphan
337+
/// rules.
338+
// FIXME: Merge this with the forced ambiguity candidates, so those don't use `Misc`.
339+
CoherenceUnknowable,
335340
}

compiler/rustc_middle/src/traits/solve/inspect.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ pub enum ProbeKind<'tcx> {
141141
TryNormalizeNonRigid { result: QueryResult<'tcx> },
142142
/// Probe entered when normalizing the self ty during candidate assembly
143143
NormalizedSelfTyAssembly,
144-
/// Some candidate to prove the current goal.
145-
///
146-
/// FIXME: Remove this in favor of always using more strongly typed variants.
147-
MiscCandidate { name: &'static str, result: QueryResult<'tcx> },
148144
/// A candidate for proving a trait or alias-relate goal.
149145
TraitCandidate { source: CandidateSource, result: QueryResult<'tcx> },
150146
/// Used in the probe that wraps normalizing the non-self type for the unsize
@@ -154,4 +150,6 @@ pub enum ProbeKind<'tcx> {
154150
/// do a probe to find out what projection type(s) may be used to prove that
155151
/// the source type upholds all of the target type's object bounds.
156152
UpcastProjectionCompatibility,
153+
/// Try to unify an opaque type with an existing key in the storage.
154+
OpaqueTypeStorageLookup { result: QueryResult<'tcx> },
157155
}

compiler/rustc_middle/src/traits/solve/inspect/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ impl<'a, 'b> ProofTreeFormatter<'a, 'b> {
112112
ProbeKind::UpcastProjectionCompatibility => {
113113
write!(self.f, "PROBING FOR PROJECTION COMPATIBILITY FOR UPCASTING:")
114114
}
115-
ProbeKind::MiscCandidate { name, result } => {
116-
write!(self.f, "CANDIDATE {name}: {result:?}")
115+
ProbeKind::OpaqueTypeStorageLookup { result } => {
116+
write!(self.f, "PROBING FOR AN EXISTING OPAQUE: {result:?}")
117117
}
118118
ProbeKind::TraitCandidate { source, result } => {
119119
write!(self.f, "CANDIDATE {source:?}: {result:?}")

0 commit comments

Comments
 (0)