about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/query.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-03-04 19:37:01 -0800
committerGitHub <noreply@github.com>2025-03-04 19:37:01 -0800
commitb3d7c1483da2172644b15a923ffb001960e8feb1 (patch)
treebaa05397458d06c306206cb3badf69a2316175c8 /compiler/rustc_mir_transform/src/coverage/query.rs
parent99efb4204dfdccb38355334f8d12db1122fb0c16 (diff)
parent3e5fddc95ea2d8851def90b940030d1c97bd5b00 (diff)
downloadrust-b3d7c1483da2172644b15a923ffb001960e8feb1.tar.gz
rust-b3d7c1483da2172644b15a923ffb001960e8feb1.zip
Rollup merge of #137913 - compiler-errors:struct-field-default-generic, r=BoxyUwU
Allow struct field default values to reference struct's generics

Right now, the default field value feature (https://github.com/rust-lang/rust/issues/132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit.

This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly.

There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do.

r? `````@boxyuwu````` or reassign

I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted.

Fixes #137896
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/query.rs')
0 files changed, 0 insertions, 0 deletions