rust/tests/ui/traits/next-solver
bors 69b76df90c Auto merge of #145706 - lcnr:uniquification, r=BoxyUwU
change HIR typeck region uniquification handling approach

rust-lang/rust#144405 causes structural lookup of opaque types to not work during HIR typeck, so instead avoid uniquifying goals and instead only reprove them if MIR borrowck actually encounters an error.

This doesn't perfectly maintain the property that HIR typeck succeeding implies that MIR typeck succeeds, instead weakening this check to only guarantee that HIR typeck implies that MIR typeck succeeds modulo region uniquification. This means we still get the actually desirable ICEs if we MIR building is broken or we forget to check some property in HIR typeck, without having to deal with the fallout of uniquification in HIR typeck itself.

We report errors using the original obligation sources of HIR typeck so diagnostics aren't that negatively impacted either.

Here's the history of region uniquification while working on the new trait solver:
- rust-lang/rust#107981
- rust-lang/rust#110180
- rust-lang/rust#114117
- rust-lang/rust#130821
- rust-lang/rust#144405
- rust-lang/rust#145706 <- we're here 🎉

r? `@BoxyUwU`
2025-08-23 20:16:58 +00:00
..
alias-relate Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
assembly change HIR typeck unification handling approach 2025-08-22 13:39:38 +02:00
canonical Manually walk into WF obligations in BestObligation proof tree visitor 2025-01-31 18:21:58 +00:00
coercion eagerly check nested obligations when coercing fndefs 2025-05-21 11:09:48 +00:00
coherence tests: add #![rustc_no_implicit_bounds] 2025-06-27 05:34:08 +00:00
cycles On E0277, point at type that doesn't implement bound 2025-08-22 17:55:15 +00:00
diagnostics On E0277, point at type that doesn't implement bound 2025-08-22 17:55:15 +00:00
generalize resolve FIXME 2024-12-18 16:35:06 +01:00
method Use DeepRejectCtxt in assemble_inherent_candidates_from_param 2025-05-21 10:02:54 +00:00
normalization-shadowing handle global trait bounds defining assoc type 2025-01-20 18:51:45 +01:00
normalize Consider param-env for fast path 2025-07-20 17:45:01 +00:00
opaques Apply nested goals certainty to InspectGoals for normalizes-to 2025-06-09 17:02:09 +00:00
overflow tests: add #![rustc_no_implicit_bounds] 2025-06-27 05:34:08 +00:00
typeck Auto merge of #133559 - compiler-errors:structurally-resolve-adjust-for-branch, r=lcnr 2024-12-06 04:55:35 +00:00
alias-bound-preference.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
alias-bound-unsound.rs Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
alias-bound-unsound.stderr Bless tests due to extra error reporting due to normalizing types that are not WF 2024-11-27 03:34:58 +00:00
alias-eq-in-canonical-response.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
alias-sub.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ambiguous-impl-in-resolve.rs Don't ICE when codegen_select returns ambiguity in new solver 2024-04-25 11:49:12 -04:00
array-default.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
async.fail.stderr Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
async.rs Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
auto-with-drop_tracking_mir.fail.stderr On E0277, point at type that doesn't implement bound 2025-08-22 17:55:15 +00:00
auto-with-drop_tracking_mir.rs Use a proof tree visitor to refine the Obligation for error reporting 2024-05-02 21:56:14 -04:00
borrowck-error.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-error.stderr consistently use "next solver" instead of "new solver" 2023-12-14 15:22:37 +01:00
builtin-fn-must-return-sized.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
builtin-fn-must-return-sized.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
cast-checks-handling-projections.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-inference-guidance.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-signature-inference-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-signature-inference-hr-ambig-alias-naming-self.rs "normalize" signature before checking mentions self 2025-01-28 14:11:29 +00:00
closure-signature-inference.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-substs-ambiguity.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-param-placeholder.fail.stderr consistently use "next solver" instead of "new solver" 2023-12-14 15:22:37 +01:00
const-param-placeholder.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
constrain-alias-goals-in-unsize.rs Process alias-relate obligations in CoerceUnsized loop 2024-02-27 20:07:58 +00:00
coroutine.fail.stderr Be better at reporting alias errors 2024-10-15 20:42:17 -04:00
coroutine.rs fix tests 2024-11-02 16:58:50 +00:00
deduce-ty-from-object.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dedup-regions.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
destruct.rs Gate const drop behind const_destruct feature, and fix const_precise_live_drops post-drop-elaboration check 2024-11-22 16:54:40 +00:00
dont-canonicalize-re-error.rs tests: add #![rustc_no_implicit_bounds] 2025-06-27 05:34:08 +00:00
dont-canonicalize-re-error.stderr Rollup merge of #142671 - davidtwco:no-default-bounds-attr, r=lcnr 2025-06-27 15:04:52 +02:00
dont-coerce-infer-to-dyn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-elaborate-for-projections.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-ice-on-assoc-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-ice-on-assoc-projection.stderr Bless tests 2024-01-13 12:46:58 -05:00
dont-ice-on-bad-transmute-in-typeck.rs Don't ice on bad transmute in typeck in new solver 2025-01-06 17:56:16 +00:00
dont-ice-on-bad-transmute-in-typeck.stderr Deeply normalize in the new solver in WF 2025-05-05 15:52:38 +00:00
dont-loop-fulfill-on-region-constraints.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-normalize-proj-with-error.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-normalize-proj-with-error.stderr consistently use "next solver" instead of "new solver" 2023-12-14 15:22:37 +01:00
dyn-any-dont-prefer-impl.rs change selection test to run-pass 2024-05-28 04:44:45 +00:00
dyn-incompatibility.rs Register a dummy candidate for failed structural normalization during candiate assembly 2024-10-15 20:42:17 -04:00
dyn-incompatibility.stderr Use trait name instead of full constraint in suggestion message 2024-12-07 21:29:58 +00:00
elaborate-item-bounds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
escaping-bound-vars-in-writeback-normalization.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
float-canonical.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn-trait-closure.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn-trait.rs Check that alias-relate terms are WF if reporting an error in alias-relate 2024-06-13 08:52:35 -04:00
fn-trait.stderr Be better at reporting alias errors 2024-10-15 20:42:17 -04:00
gat-wf.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
gat-wf.stderr Deeply normalize associated type bounds before proving them 2025-02-17 17:21:24 +00:00
global-cache-and-parallel-frontend.rs compiler: Inform the solver of concurrency 2024-09-09 13:07:48 -07:00
global-cache-and-parallel-frontend.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
global-param-env-after-norm.rs Only prefer param-env candidates if they remain non-global after norm 2025-05-07 16:00:21 +00:00
higher-ranked-dyn-bounds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
int-var-alias-eq.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
int-var-is-send.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-118950-root-region.rs Deeply normalize in the new solver in WF 2025-05-05 15:52:38 +00:00
issue-118950-root-region.stderr Remove Symbol for Named LateParam/Bound variants 2025-07-04 18:14:22 +00:00
iter-filter-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
known-type-outlives-has-constraints.rs Make sure to scrape region constraints from deeply normalizing type outlives assumptions in borrowck 2025-01-14 19:13:18 +00:00
lazy-nested-obligations-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lazy-nested-obligations-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lazy-nested-obligations-3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
more-object-bound.rs Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
more-object-bound.stderr Deeply normalize obligations in BestObligation 2025-04-10 18:58:04 +00:00
nested-alias-bound.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-obligations-with-bound-vars-gat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-param-env-const-fold.rs Do not eagerly fold consts in normalize_param_env_or_error if new solver 2025-05-21 09:23:36 +00:00
non-wf-ret.rs Check xform_ret_ty for WF in the new solver to improve method winnowing 2024-11-27 20:46:08 +00:00
normalize-in-implied_outlives_bounds.rs Deeply normalize when computing implied outlives bounds 2024-12-02 22:51:17 +00:00
object-soundness-requires-generalization.rs tests: ensure disabled tests have a reason 2025-04-12 15:24:25 +08:00
opportunistic-region-resolve.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
overflow-plus-ambiguity-normalizes-to-response.rs Use MaybeCause::or to allow constraints from overflows if they are combined with ambiguity 2025-05-07 17:12:15 +00:00
param-discr-kind.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
pointee.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
prefer-candidate-no-constraints.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
prefer-param-env-on-ambiguity.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
projection-discr-kind.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
projection-discr-kind.stderr consistently use "next solver" instead of "new solver" 2023-12-14 15:22:37 +01:00
rpitit-cycle-due-to-rigid.rs Don't assemble non-env/bound candidates if projection is rigid 2025-04-18 01:44:06 +00:00
slice-match-byte-lit.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
specialization-transmute.rs handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-transmute.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-unconstrained.rs handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
specialization-unconstrained.stderr handle specialization in the new trait solver 2025-04-25 17:59:33 +00:00
stall-num-var-auto-trait.fallback.stderr consistently use "next solver" instead of "new solver" 2023-12-14 15:22:37 +01:00
stall-num-var-auto-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
structural-resolve-field.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
structurally-normalize-in-borrowck-field-projection.rs Structurally resolve before applying projection in borrowck 2024-11-27 20:39:49 +00:00
supertrait-alias-1.rs tests: add #![rustc_no_implicit_bounds] 2025-06-27 05:34:08 +00:00
supertrait-alias-2.rs Fix replacing supertrait aliases in ReplaceProjectionWith 2025-04-16 20:05:55 +00:00
supertrait-alias-3.rs Fix replacing supertrait aliases in ReplaceProjectionWith 2025-04-16 20:05:55 +00:00
supertrait-alias-4.rs Fix replacing supertrait aliases in ReplaceProjectionWith 2025-04-16 20:05:55 +00:00
try-example.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unevaluated-const-impl-trait-ref.fails.stderr Spell out other trait diagnostic 2024-06-12 12:34:47 +00:00
unevaluated-const-impl-trait-ref.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsafe-auto-trait-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsize-although-ambiguous.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsize-good.rs Delete tuple unsizing 2025-02-27 10:26:33 +00:00
unsound-region-obligation.rs Pass spans around new solver 2025-02-05 18:32:06 +00:00
unsound-region-obligation.stderr Pass spans around new solver 2025-02-05 18:32:06 +00:00
well-formed-in-relate.rs Allow WellFormed goals to be returned from relating in new solver 2025-03-24 16:57:06 +00:00
well-formed-in-relate.stderr Allow WellFormed goals to be returned from relating in new solver 2025-03-24 16:57:06 +00:00
winnow-specializing-impls.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00