rust/tests/ui/impl-trait/in-trait
bors 243c5a35e1 Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type

This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct  `DisambiguatorState` instances must ensure that that the def paths are unique without its help.

Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer.

`DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those.

cc `@oli-obk`
2025-05-05 11:50:43 +00:00
..
auxiliary RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
alias-bounds-when-not-wf.rs Be better at reporting alias errors 2024-10-15 20:42:17 -04:00
alias-bounds-when-not-wf.stderr Manually walk into WF obligations in BestObligation proof tree visitor 2025-01-31 18:21:58 +00:00
anonymize-binders-for-refine.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
assumed-wf-bounds-in-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
async-and-ret-ref.rs Print RPITIT like an opaque 2024-02-27 17:43:40 +00:00
async-and-ret-ref.stderr Print RPITIT like an opaque 2024-02-27 17:43:40 +00:00
bad-item-bound-within-rpitit-2.rs Stop proving outlives constraints on regions we already reported errors on 2024-05-29 09:27:07 +00:00
bad-item-bound-within-rpitit-2.stderr Stop proving outlives constraints on regions we already reported errors on 2024-05-29 09:27:07 +00:00
bad-item-bound-within-rpitit.rs
bad-item-bound-within-rpitit.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
bad-projection-from-opaque.rs Move an impl-Trait check from AST validation to AST lowering 2024-10-27 07:41:52 +01:00
bad-projection-from-opaque.stderr Move an impl-Trait check from AST validation to AST lowering 2024-10-27 07:41:52 +01:00
box-coerce-span-in-default.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cannot-capture-intersection.rs Bless test fallout 2024-08-17 12:43:25 -04:00
cannot-capture-intersection.stderr Bless test fallout 2024-08-17 12:43:25 -04:00
check-wf-on-non-defaulted-rpitit.rs
check-wf-on-non-defaulted-rpitit.stderr
cycle-effective-visibilities-during-dyn-compatibility-check.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
cycle-effective-visibilities-during-dyn-compatibility-check.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
cycle-if-impl-doesnt-apply.rs Do not compute type_of for impl item if impl where clauses are unsatisfied 2025-04-28 17:15:11 +00:00
deep-match-works.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
deep-match.rs
deep-match.stderr
default-body-type-err-2.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
default-body-type-err-2.stderr Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
default-body-type-err.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
default-body-type-err.stderr Stop inverting expectation in normalization errors 2024-10-16 13:44:56 -04:00
default-body-with-rpit.rs Deeply normalize associated type bounds before proving them 2025-02-17 17:21:24 +00:00
default-body.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
default-method-binder-shifting.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
default-method-constraint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
do-not-imply-from-trait-impl.rs Actually use placeholder regions for trait method late bound regions in collect_return_position_impl_trait_in_trait_tys 2024-11-24 23:11:49 +00:00
do-not-imply-from-trait-impl.stderr Actually use placeholder regions for trait method late bound regions in collect_return_position_impl_trait_in_trait_tys 2024-11-24 23:11:49 +00:00
doesnt-satisfy.rs
doesnt-satisfy.stderr Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
dont-consider-unconstrained-rpitits.rs Filter out RPITITs when suggesting unconstrained assoc type on too many generics 2025-01-30 18:51:49 +00:00
dont-consider-unconstrained-rpitits.stderr Filter out RPITITs when suggesting unconstrained assoc type on too many generics 2025-01-30 18:51:49 +00:00
dont-probe-missing-item-name-2.rs Don't compute name of associated item if it's an RPITIT 2025-04-20 16:08:39 +00:00
dont-probe-missing-item-name-2.stderr Don't compute name of associated item if it's an RPITIT 2025-04-20 16:08:39 +00:00
dont-probe-missing-item-name-3.rs Don't compute name of associated item if it's an RPITIT 2025-04-20 16:08:39 +00:00
dont-probe-missing-item-name-3.stderr Don't compute name of associated item if it's an RPITIT 2025-04-20 16:08:39 +00:00
dont-probe-missing-item-name-4.rs Don't use item name to look up associated item from trait item 2025-04-25 01:57:45 +00:00
dont-probe-missing-item-name-4.stderr Don't use item name to look up associated item from trait item 2025-04-25 01:57:45 +00:00
dont-probe-missing-item-name.rs Don't compute name of associated item if it's an RPITIT 2025-04-15 18:46:26 +00:00
dont-probe-missing-item-name.stderr Don't compute name of associated item if it's an RPITIT 2025-04-15 18:46:26 +00:00
dont-project-to-rpitit-with-no-value.rs
dont-project-to-rpitit-with-no-value.stderr
dump.rs Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
dump.stderr Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
dyn-compatibility-sized.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
dyn-compatibility.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
dyn-compatibility.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
early.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
encode.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
ensure-rpitits-are-created-before-freezing.rs Ensure RPITITs are created before def-id freezing 2024-03-14 20:30:57 -04:00
ensure-rpitits-are-created-before-freezing.stderr Ensure RPITITs are created before def-id freezing 2024-03-14 20:30:57 -04:00
expeced-refree-to-map-to-reearlybound-ice-108580.rs add test for ICE: no errors encountered even though delay_span_bug issued, expected ReFree to map to ReEarlyBound #108580 2024-03-24 10:35:24 +01:00
expeced-refree-to-map-to-reearlybound-ice-108580.stderr More sophisticated span trimming 2025-02-21 00:41:17 +00:00
false-positive-predicate-entailment-error.current.stderr Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
false-positive-predicate-entailment-error.rs Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
foreign-dyn-error.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
foreign-dyn-error.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
foreign.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
foreign.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
gat-outlives.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
gat-outlives.stderr
generics-mismatch.rs
generics-mismatch.stderr
issue-102140.rs
issue-102140.stderr
issue-102301.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
issue-102571.rs
issue-102571.stderr
late-bound-in-object-assocty.rs Stabilize the 2024 edition 2024-11-22 11:12:15 -08:00
lifetime-in-associated-trait-bound.rs Stabilize associated type bounds 2024-03-08 20:56:25 +00:00
method-compatability-via-leakage-cycle.current.stderr Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
method-compatability-via-leakage-cycle.next.stderr Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
method-compatability-via-leakage-cycle.rs add RPITIT tests: method compat auto trait leakage 2025-04-14 13:26:13 +02:00
method-compatability-via-leakage.rs add RPITIT tests: method compat auto trait leakage 2025-04-14 13:26:13 +02:00
method-signature-matches.lt.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
method-signature-matches.mismatch_async.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
method-signature-matches.mismatch.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
method-signature-matches.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
method-signature-matches.too_few.stderr Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
method-signature-matches.too_many.stderr Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
mismatched-where-clauses.rs Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
mismatched-where-clauses.stderr Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
missing-lt-outlives-in-rpitit-114274.rs
missing-lt-outlives-in-rpitit-114274.stderr
missing-static-bound-from-impl.rs Print RPITIT like an opaque 2024-02-27 17:43:40 +00:00
missing-static-bound-from-impl.stderr Print RPITIT like an opaque 2024-02-27 17:43:40 +00:00
nested-rpitit-bounds.rs Deeply normalize associated type bounds before proving them 2025-02-17 17:21:24 +00:00
nested-rpitit.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
opaque-and-lifetime-mismatch.rs Do not recover missing lifetime with random in-scope lifetime 2025-03-03 05:57:55 +00:00
opaque-and-lifetime-mismatch.stderr Do not recover missing lifetime with random in-scope lifetime 2025-03-03 05:57:55 +00:00
opaque-in-impl-is-opaque.rs
opaque-in-impl-is-opaque.stderr
opaque-in-impl.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
opaque-variances.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
outlives-in-nested-rpit.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
placeholder-implied-bounds.rs borrowck: more eagerly prepopulate opaques 2024-05-06 16:04:57 +00:00
refine-captures.rs Stabilize precise_capturing_in_traits 2025-03-23 14:11:04 +00:00
refine-captures.stderr Stabilize precise_capturing_in_traits 2025-03-23 14:11:04 +00:00
refine-cycle.rs do not leak auto traits in item bounds 2025-04-14 13:26:13 +02:00
refine-err.rs Don't trigger refinement lint if predicates reference errors 2024-08-22 12:34:12 -04:00
refine-err.stderr Don't trigger refinement lint if predicates reference errors 2024-08-22 12:34:12 -04:00
refine-normalize.rs Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
refine-resolution-errors.rs Do not project when there are unconstrained impl params 2025-01-03 05:01:14 +00:00
refine-resolution-errors.stderr Do not project when there are unconstrained impl params 2025-01-03 05:01:14 +00:00
refine.rs Split refining_impl_trait lint into _reachable, _internal variants 2024-03-05 16:19:16 -08:00
refine.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
return-dont-satisfy-bounds.rs Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
return-dont-satisfy-bounds.stderr Remove global next_disambiguator state and handle it with a DisambiguatorState type 2025-04-29 13:22:38 +02:00
return-type-notation.rs Promote crashes tests to ui. 2024-10-30 16:19:53 +00:00
return-type-notation.stderr Promote crashes tests to ui. 2024-10-30 16:19:53 +00:00
reveal.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
rpitit-cycle-in-generics-of.rs Uplift some feeding out of associated_type_for_impl_trait_in_impl and into queries 2024-03-05 15:55:31 +00:00
rpitit-hidden-types-self-implied-wf-via-param.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rpitit-hidden-types-self-implied-wf-via-param.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
rpitit-hidden-types-self-implied-wf.rs
rpitit-hidden-types-self-implied-wf.stderr Actually use placeholder regions for trait method late bound regions in collect_return_position_impl_trait_in_trait_tys 2024-11-24 23:11:49 +00:00
rpitit-shadowed-by-missing-adt.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
rpitit-shadowed-by-missing-adt.stderr RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
shorthand-projection-in-rpitit-bound.rs Make sure type_param_predicates resolves correctly for RPITIT 2024-10-30 22:30:28 +00:00
sibling-function-constraint.rs
sibling-function-constraint.stderr
signature-mismatch.failure.stderr Actually use placeholder regions for trait method late bound regions in collect_return_position_impl_trait_in_trait_tys 2024-11-24 23:11:49 +00:00
signature-mismatch.rs Actually use placeholder regions for trait method late bound regions in collect_return_position_impl_trait_in_trait_tys 2024-11-24 23:11:49 +00:00
sized-rpits-dont-need-pointer-like.rs Don't check RPITITs that are Self:Sized for PointerLike 2024-12-10 17:23:02 +00:00
span-bug-issue-121457.rs Improve AssocItem::descr. 2025-04-11 11:03:08 +10:00
span-bug-issue-121457.stderr Improve AssocItem::descr. 2025-04-11 11:03:08 +10:00
specialization-broken.rs
specialization-broken.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
specialization-substs-remap.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
success.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
suggest-missing-item.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
suggest-missing-item.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
suggest-missing-item.stderr
synthetic-hir-has-parent.rs Tests for getting parent of synthetic HIR 2024-04-03 17:44:47 -04:00
synthetic-hir-has-parent.stderr Tests for getting parent of synthetic HIR 2024-04-03 17:44:47 -04:00
trait-more-generics-than-impl.rs Differentiate between methods and associated functions 2024-08-10 00:54:16 +00:00
trait-more-generics-than-impl.stderr Differentiate between methods and associated functions 2024-08-10 00:54:16 +00:00
unconstrained-lt.rs
unconstrained-lt.stderr
variance.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
variance.stderr Remap impl-trait lifetimes on HIR instead of AST lowering. 2024-10-30 16:18:50 +00:00
variances-of-gat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
wf-bounds.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
wf-bounds.stderr Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
where-clause.rs Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00