Empowering everyone to build reliable and efficient software.
Go to file
Scott McMurray 18ca8bf8ee Take more advantage of the isize::MAX limit in Layout
Things like `padding_needed_for` are current implemented being super careful to handle things like `Layout::size` potentially being `usize::MAX`.

But now that 95295 has happened, that's no longer a concern.  It's possible to add two `Layout::size`s together without risking overflow now.

So take advantage of that to remove a bunch of checked math that's not actually needed.  For example, the round-up-and-add-next-size in `extend` doesn't need any overflow checks at all, just the final check for compatibility with the alignment.

(And while I was doing that I made it all unstably const, because there's nothing in `Layout` that's fundamentally runtime-only.)
2024-09-17 20:05:57 -07:00
.github Update library/Cargo.toml in weekly job 2024-08-19 07:30:11 -05:00
compiler Rollup merge of #129812 - RalfJung:box-custom-alloc, r=compiler-errors 2024-08-31 14:46:14 +02:00
library Take more advantage of the isize::MAX limit in Layout 2024-09-17 20:05:57 -07:00
LICENSES
src Rollup merge of #129785 - RalfJung:miri-sync, r=RalfJung 2024-08-31 14:46:13 +02:00
tests Rollup merge of #129760 - cuviper:old-timey, r=compiler-errors 2024-08-31 14:46:10 +02: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 #129526 - compiler-errors:fx, r=lqd 2024-08-26 01:49:02 +02:00
Cargo.toml Switch to using the v2 resolver in most workspaces 2024-08-18 13:59:09 -05:00
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 Update RELEASES.md 2024-08-22 09:19:22 +02:00
REUSE.toml REUSE.toml: Copyright text isn't parsed as Markdown. 2024-08-06 11:04:55 +01:00
rust-bors.toml
rustfmt.toml
triagebot.toml mark joboet as on vacation 2024-08-30 21:28:42 +02: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.