1
Fork 0
Empowering everyone to build reliable and efficient software. Gabriel's commits. https://www.rust-lang.org/
Find a file
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
.github Update library/Cargo.toml in weekly job 2024-08-19 07:30:11 -05:00
compiler Rollup merge of #129829 - compiler-errors:decode-non-optional, r=lcnr 2024-09-02 22:35:19 +02:00
library Rollup merge of #129748 - RalfJung:box-validity, r=workingjubilee 2024-09-02 22:35:18 +02:00
LICENSES
src Auto merge of #129873 - matthiaskrgr:rollup-bv849ud, r=matthiaskrgr 2024-09-02 13:41:42 +00:00
tests Auto merge of #129317 - compiler-errors:expectation-subtyping, r=lcnr 2024-09-02 16:08:50 +00:00
.clang-format
.editorconfig
.git-blame-ignore-revs Exclude the copy blessing from git blame 2024-08-18 16:09:03 -07:00
.gitattributes
.gitignore gitignore: ignore ICE reports regardless of directory 2024-08-25 14:19:05 +03:00
.gitmodules
.ignore
.mailmap
Cargo.lock Rollup merge of #129619 - sunshowers:update-stacker, r=Mark-Simulacrum 2024-09-01 03:58:04 +02:00
Cargo.toml
CODE_OF_CONDUCT.md
config.example.toml document miri and cargo-miri in build.tools 2024-08-22 08:32:39 +03:00
configure
CONTRIBUTING.md
COPYRIGHT
INSTALL.md
LICENSE-APACHE
LICENSE-MIT
README.md
RELEASES.md Remove the relnote for rustdoc's *unstable* --remap-path-prefix 2024-08-30 17:56:17 -07:00
REUSE.toml
rust-bors.toml
rustfmt.toml
triagebot.toml Mark myself as on vacation for triagebot 2024-08-31 21:24:47 -05:00
x
x.ps1
x.py

This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.

Why Rust?

  • Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrate with other languages.

  • Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.

  • Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).

Quick Start

Read "Installation" from The Book.

Installing from Source

If you really want to install from source (though this is not recommended), see INSTALL.md.

Getting Help

See https://www.rust-lang.org/community for a list of chat platforms and forums.

Contributing

See CONTRIBUTING.md.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Trademark

The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").

If you want to use these names or brands, please read the media guide.

Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.