rust/tests/ui/dyn-compatibility
León Orell Valerian Liehr 618c15eb6c
Reject const projections behind trait aliases that mention Self
This fully rewords the diagnostic that was previously only emitted for assoc ty bindings.
That's because it incorrectly called trait aliases *type aliases* and didn't really
make it clear what the root cause is.

The added test used to ICE prior to this change.

I've double-checked that the preexisting test I've modified still ICEs in
nightly-2025-03-29.
2026-01-21 12:53:47 +01:00
..
almost-supertrait-associated-type.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
almost-supertrait-associated-type.stderr Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
assoc_const_bounds.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_const_bounds_sized.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds.rs Fix ICE when multiple supertrait substitutions need assoc but only one is provided 2024-12-11 19:53:40 +00:00
assoc_type_bounds.stderr Generalize diag for missing assoc types to account for assoc consts 2026-01-21 12:53:46 +01:00
assoc_type_bounds2.rs Fix ICE when multiple supertrait substitutions need assoc but only one is provided 2024-12-11 19:53:40 +00:00
assoc_type_bounds2.stderr Generalize diag for missing assoc types to account for assoc consts 2026-01-21 12:53:46 +01:00
assoc_type_bounds_implicit_sized.fixed UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_implicit_sized.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_implicit_sized.stderr UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_sized.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_sized_others.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_sized_others.stderr Generalize diag for missing assoc types to account for assoc consts 2026-01-21 12:53:46 +01:00
assoc_type_bounds_sized_unnecessary.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_sized_unnecessary.stderr UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
assoc_type_bounds_sized_used.rs trait_sel: don't require predicates of aliases hold 2025-10-15 09:35:05 +01:00
assoc_type_bounds_sized_used.stderr trait_sel: don't require predicates of aliases hold 2025-10-15 09:35:05 +01:00
associated-consts.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
associated-consts.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
associated-consts.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
associated_type_bound_mentions_self.rs Ignore Self in bounds check for associated types with Self:Sized 2025-02-15 20:38:14 +00:00
avoid-ice-on-warning-2.new.stderr Fix typo in hir lowering lint diag 2025-03-14 21:03:21 +00:00
avoid-ice-on-warning-2.old.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
avoid-ice-on-warning-2.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
avoid-ice-on-warning-3.new.stderr Fix typo in hir lowering lint diag 2025-03-14 21:03:21 +00:00
avoid-ice-on-warning-3.old.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
avoid-ice-on-warning-3.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
avoid-ice-on-warning.new.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
avoid-ice-on-warning.old.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
avoid-ice-on-warning.rs Don't assume traits used as type are trait objs 2024-10-11 17:36:04 +02:00
bare-trait-dont-suggest-dyn.new.fixed Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
bare-trait-dont-suggest-dyn.new.stderr Don't assume traits used as type are trait objs 2024-10-11 17:36:04 +02:00
bare-trait-dont-suggest-dyn.old.stderr future-incompat lints: don't link to the nightly edition-guide version 2025-07-16 01:44:02 -07:00
bare-trait-dont-suggest-dyn.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
bounds.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
bounds.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
by-value-self-use.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
by-value-self-use.stderr UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
by-value-self.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
call-when-assoc-ty-is-sized.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
default-param-self-projection.rs Properly report error when object type param default references self 2025-01-24 04:07:10 +00:00
default-param-self-projection.stderr Fix handling of const params defaults that ref Self & generalize diag 2026-01-21 12:53:47 +01:00
dyn-compatible-trait-implementation-20939.rs Rehome tests/ui/issues/ tests [3/?] 2025-08-04 16:43:53 -04:00
dyn-compatible-trait-implementation-20939.stderr Rehome tests/ui/issues/ tests [3/?] 2025-08-04 16:43:53 -04:00
elaborated-predicates-ordering.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
erroneous_signature.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
erroneous_signature.stderr Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
gat-incompatible-supertrait.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
gat-incompatible-supertrait.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
generics.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
generics.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
generics.stderr Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
impossible-predicates-multiple_supertrait_upcastable-check.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
item-bounds-can-reference-self.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
mention-correct-dyn-incompatible-trait.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
mention-correct-dyn-incompatible-trait.stderr Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
mentions-Self-in-super-predicates.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
mentions-Self-in-super-predicates.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
mentions-Self.curr.stderr Remove dyn_compatible_for_dispatch 2025-02-24 18:48:40 +00:00
mentions-Self.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
mentions-Self.stderr Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
metasized.rs Replace #[rustc_do_not_implement_via_object] with #[rustc_dyn_incompatible_trait], which makes the marked trait dyn-incompatible. 2026-01-20 12:54:40 -06:00
missing-assoc-type.rs Refactor dyn-compatibility error and suggestions 2025-01-22 09:20:57 -08:00
missing-assoc-type.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
multiple-supers-should-work.rs Do not deduplicate list of associated types provided by dyn principal 2025-02-21 19:32:45 +00:00
no-duplicate-e0038.rs Add regression test for 128705 2025-11-21 23:03:39 +09:00
no-duplicate-e0038.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
no-static.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
no-static.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
no-static.stderr Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
phantom-fn.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
pointeesized.rs Replace #[rustc_do_not_implement_via_object] with #[rustc_dyn_incompatible_trait], which makes the marked trait dyn-incompatible. 2026-01-20 12:54:40 -06:00
reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs Don't assume traits used as type are trait objs 2024-10-11 17:36:04 +02:00
reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.stderr Make missing lifetime suggestion verbose 2025-06-24 18:59:42 +00:00
require-assoc-for-all-super-substs.rs Fix ICE when multiple supertrait substitutions need assoc but only one is provided 2024-12-11 19:53:40 +00:00
require-assoc-for-all-super-substs.stderr Generalize diag for missing assoc types to account for assoc consts 2026-01-21 12:53:46 +01:00
sized-2.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
sized-2.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
sized-2.stderr Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
sized-3.rs Replace #[rustc_do_not_implement_via_object] with #[rustc_dyn_incompatible_trait], which makes the marked trait dyn-incompatible. 2026-01-20 12:54:40 -06:00
sized-3.stderr Replace #[rustc_do_not_implement_via_object] with #[rustc_dyn_incompatible_trait], which makes the marked trait dyn-incompatible. 2026-01-20 12:54:40 -06:00
sized.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
sized.rs Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
sized.stderr Deduplicate dyn compatibility violations due to coercion 2025-05-26 10:57:54 +00:00
spurious-dyn-compat-errors-58734.rs Gate 2015 UI tests 2025-11-27 11:19:00 -05:00
spurious-dyn-compat-errors-58734.stderr Gate 2015 UI tests 2025-11-27 11:19:00 -05:00
supertrait-mentions-GAT.rs Merge unboxed trait object error suggestion into regular dyn incompat error 2025-06-13 13:54:06 +00:00
supertrait-mentions-GAT.stderr mGCA: Make traits with type assoc consts dyn compatible... 2026-01-21 12:53:44 +01:00
supertrait-mentions-Self.rs UI tests: Rename "object safe" to "dyn compatible" 2024-10-10 01:13:29 +02:00
supertrait-mentions-Self.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
taint-const-eval.curr.stderr Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
taint-const-eval.rs Check statics' type in type_of. 2025-07-25 23:39:26 +00:00
taint-const-eval.stderr Check statics' type in type_of. 2025-07-25 23:39:26 +00:00
type-projection-behind-trait-alias-mentions-self.rs Reject const projections behind trait aliases that mention Self 2026-01-21 12:53:47 +01:00
type-projection-behind-trait-alias-mentions-self.stderr Reject const projections behind trait aliases that mention Self 2026-01-21 12:53:47 +01:00
undispatchable-receiver-and-wc-references-Self.rs Do not try to confirm non-dyn compatible method 2025-05-23 12:20:35 +00:00
undispatchable-receiver-and-wc-references-Self.stderr Do not try to confirm non-dyn compatible method 2025-05-23 12:20:35 +00:00