rust/src
bors 591ecb88df Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlin
miri: make vtable addresses not globally unique

Miri currently gives vtables a unique global address. That's not actually matching reality though. So this PR enables Miri to generate different addresses for the same type-trait pair.

To avoid generating an unbounded number of `AllocId` (and consuming unbounded amounts of memory), we use the "salt" technique that we also already use for giving constants non-unique addresses: the cache is keyed on a "salt" value n top of the actually relevant key, and Miri picks a random salt (currently in the range `0..16`) each time it needs to choose an `AllocId` for one of these globals -- that means we'll get up to 16 different addresses for each vtable. The salt scheme is integrated into the global allocation deduplication logic in `tcx`, and also used for functions and string literals. (So this also fixes the problem that casting the same function to a fn ptr over and over will consume unbounded memory.)

r? `@saethlin`
Fixes https://github.com/rust-lang/miri/issues/3737
2024-08-13 04:32:34 +00:00
..
bootstrap Rollup merge of #129000 - RalfJung:miri-bootstrap-clear, r=onur-ozkan 2024-08-12 23:10:51 +02:00
ci Install zstd in dist builder image. 2024-08-09 05:55:40 -07:00
doc Auto merge of #122362 - Zoxc:rustc_driver_static_std, r=oli-obk,lqd,bjorn3,Kobzol 2024-08-11 15:08:03 +00:00
etc Fix debuginfo providers/tests 2024-08-11 16:51:22 -04:00
librustdoc Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdoc 2024-08-12 17:09:15 +02:00
llvm-project@ccf4c38bdd Update to LLVM 19 rc2 2024-08-05 11:53:11 +02:00
rustdoc-json-types rustdoc-json-types Discriminant: fix typo 2024-08-09 20:50:00 +02:00
tools Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlin 2024-08-13 04:32:34 +00:00
README.md
stage0 Bump src/stage0 with determinism 2024-07-30 15:16:35 -07:00
version Bump to 1.82 2024-07-20 10:30:39 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.