rust/compiler/rustc_metadata
Matthias Krüger c6410f5066
Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr
Make decoding non-optional `LazyArray` panic if not set

Tables may be [defined](9649706ead/compiler/rustc_metadata/src/rmeta/mod.rs (L377)) as `optional:` or `defaulted:`. If optional, if we try to read a value from a key that was never encoded, we should panic. This has high value in ensuring correctness over a defaulted table, so the tradeoff is worth considering, since it signals the compiler has a buggy encode impl, rather than just defaulting to a value.

HOWEVER, `optional:` arrays were side-stepping this. So this PR fixes that, and makes `optional:` tables of `LazyArray` act like `LazyValue`, and panic if it's not assigned a value during encoding.

During this PR, I found that `deduced_param_attrs` has buggy (?? i think??) implementation where it will refuse to encode cross-crate `deduced_param_attrs` unless we're codegening, we're optimizing the library, and incremental is disabled. This seems incredibly wrong, but I don't want to fix it in this PR.
9649706ead/compiler/rustc_metadata/src/rmeta/encoder.rs (L1733-L1747)
2024-09-02 22:35:19 +02:00
..
src Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr 2024-09-02 22:35:19 +02:00
Cargo.toml deps: deduplicate the version of libloading used 2024-01-10 17:18:10 +02:00
messages.ftl Rollup merge of #128886 - GrigorenkoPV:untranslatable-diagnostic, r=nnethercote 2024-08-12 17:09:17 +02:00