Skip to content

Conversation

@fmease
Copy link
Member

@fmease fmease commented Jan 8, 2026

Part of rust-lang/rust#130300.

I'm blocking this until the relevant r-l/r PR is greenlit.

While rustc@main actually mangles assoc const bindings, it does so incorrectly since it doesn't prefix the constant with a K rendering the output ambiguous I'm pretty sure (prior art: const args get prefixed with K to distinguish them from other kinds of generic args).

@fmease
Copy link
Member Author

fmease commented Jan 8, 2026

The r-l/r PR it would unblock is: rust-lang/rust#150843. However, I'll potentially split out the symbol mangling part into separate PR (at the cost of sliming down a test).

This PR is ready.

@fmease fmease marked this pull request as ready for review January 8, 2026 23:38
@fmease fmease enabled auto-merge January 8, 2026 23:39
@fmease fmease merged commit bce5e74 into rust-lang:main Jan 15, 2026
6 checks passed
@fmease fmease deleted the v0-dyn-trait-assoc-const-bindings branch January 15, 2026 15:09
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 20, 2026
mGCA: Make trait object types with type-level associated consts dyn compatible if all of the latter are specified via bindings

Under feature `min_generic_const_args` (mGCA) (#132980), render traits with non-parametrized type-level associated constants (i.e., `#[type_const]` ones) dyn compatible but force the user to specify all type-level associated consts in the trait object type via bindings (either directly, via supertrait bounds and/or behind trait aliases) just like associated types, their sibling.

Fixes #130300 (feature request).
Fixes #136063 (bug).
Fixes #137260 (bug).
Fixes #137514 (bug).

While I'm accounting for most illegal `Self` references via const projections & params, I'm intentionally ignoring RUST-123140 (and duplicates) in this PR which is to be tackled some other time.

Additional context: Crate `rustc-demangle` had to be updated to fix v0 demangling. I've patched it in PR rust-lang/rustc-demangle#87 which was was released in version 0.1.27 via PR rust-lang/rustc-demangle#88.
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 21, 2026
mGCA: Make trait object types with type-level associated consts dyn compatible if all of the latter are specified via bindings

Under feature `min_generic_const_args` (mGCA) (#132980), render traits with non-parametrized type-level associated constants (i.e., `#[type_const]` ones) dyn compatible but force the user to specify all type-level associated consts in the trait object type via bindings (either directly, via supertrait bounds and/or behind trait aliases) just like associated types, their sibling.

Fixes #130300 (feature request).
Fixes #136063 (bug).
Fixes #137260 (bug).
Fixes #137514 (bug).

While I'm accounting for most illegal `Self` references via const projections & params, I'm intentionally ignoring RUST-123140 (and duplicates) in this PR which is to be tackled some other time.

Additional context: Crate `rustc-demangle` had to be updated to fix v0 demangling. I've patched it in PR rust-lang/rustc-demangle#87 which was was released in version 0.1.27 via PR rust-lang/rustc-demangle#88.
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 22, 2026
mGCA: Make trait object types with type-level associated consts dyn compatible

Under feature `min_generic_const_args` (mGCA) (#132980), render traits with non-parametrized type-level associated constants (i.e., `#[type_const]` ones) dyn compatible but force the user to specify all type-level associated consts in the trait object type via bindings (either directly, via supertrait bounds and/or behind trait aliases) just like associated types, their sibling.

Fixes #130300 (feature request).
Fixes #136063 (bug).
Fixes #137260 (bug).
Fixes #137514 (bug).

While I'm accounting for most illegal `Self` references via const projections & params, I'm intentionally ignoring RUST-123140 (and duplicates) in this PR which is to be tackled some other time.

Additional context: Crate `rustc-demangle` had to be updated to fix v0 demangling. I've patched it in PR rust-lang/rustc-demangle#87 which was was released in version 0.1.27 via PR rust-lang/rustc-demangle#88.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants