rust/compiler/rustc_middle/src
Matthias Krüger cdf178f776
Rollup merge of #95388 - RalfJung:rust-val-limit, r=oli-obk
interpret: make isize::MAX the limit for dynamic value sizes

We are currently enforcing `data_layout.obj_size_bound()` as the maximal dynamic size of a Rust value (including for `size_of_val_raw`), but that does not match the docs.

In particular, Miri currently falsely says that this code has UB:
```rust
#![feature(layout_for_ptr)]
fn main() {
    let size = isize::MAX as usize;
    // Creating a raw slice of size isize::MAX and asking for its size is okay.
    let s = std::ptr::slice_from_raw_parts(1usize as *const u8, size);
    assert_eq!(size, unsafe { std::mem::size_of_val_raw(s) });
}
```
2022-04-01 06:59:44 +02:00
..
dep_graph Adopt let_else in even more places 2022-02-16 22:43:39 +01:00
hir Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errors 2022-03-31 04:57:28 +02:00
infer Spellchecking compiler comments 2022-03-30 15:14:15 -04:00
middle Filter OnceNote in diagnostic infra. 2022-03-20 20:36:26 +01:00
mir interpret: make isize::MAX the limit for dynamic value sizes 2022-03-31 08:57:45 -04:00
query Auto merge of #95436 - cjgillot:static-mut, r=oli-obk 2022-03-30 22:09:56 +00:00
thir use NonHirLiteral instead of ScalarLiteral, move pattern related code to pat_is_poly in IsThirPolymorphic 2022-03-23 11:34:33 +01:00
traits obligation cause: RepeatVec -> RepeatValueCopy 2022-03-31 12:51:46 +02:00
ty Rollup merge of #95260 - compiler-errors:fn, r=davidtwco 2022-04-01 06:59:41 +02:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Swap DtorckConstraint to DropckConstraint 2022-03-24 20:35:35 +01:00
lib.rs remove [async output] from impl Future 2022-03-22 19:41:34 -07:00
lint.rs Spellchecking compiler comments 2022-03-30 15:14:15 -04:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Spellchecking compiler comments 2022-03-30 15:14:15 -04:00