rust/compiler/rustc_metadata/src
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
..
rmeta Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr 2024-09-02 22:35:19 +02:00
creader.rs rustc_metadata: remove a redundant #[allow(rustc::untranslatable_diagnostic)] 2024-08-10 14:32:56 +03:00
dependency_format.rs Ask the user to use feature(rustc_private) when linking to rustc_driver 2024-08-11 04:16:53 +02:00
errors.rs Ask the user to use feature(rustc_private) when linking to rustc_driver 2024-08-11 04:16:53 +02:00
foreign_modules.rs Do not fetch HIR in native_libs. 2023-07-17 07:37:03 +00:00
fs.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lib.rs Rollup merge of #129366 - petrochenkov:libsearch, r=jieyouxu 2024-08-31 10:08:53 +02:00
locator.rs Simplify some redundant field names 2024-08-21 01:31:42 -04:00
native_libs.rs linker: Synchronize native library search in rustc and linker 2024-08-27 22:13:31 +03:00