1
Fork 0
rust/compiler/rustc_interface/src
bors 557359f925 Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk
Prototype: Add unstable `-Z reference-niches` option

MCP: rust-lang/compiler-team#641
Relevant RFC: rust-lang/rfcs#3204

This prototype adds a new `-Z reference-niches` option, controlling the range of valid bit-patterns for reference types (`&T` and `&mut T`), thereby enabling new enum niching opportunities. Like `-Z randomize-layout`, this setting is crate-local; as such, references to built-in types (primitives, tuples, ...) are not affected.

The possible settings are (here, `MAX` denotes the all-1 bit-pattern):
| `-Z reference-niches=` | Valid range |
|:---:|:---:|
| `null` (the default) | `1..=MAX` |
| `size` | `1..=(MAX- size)` |
| `align` | `align..=MAX.align_down_to(align)` |
| `size,align` | `align..=(MAX-size).align_down_to(align)` |

------

This is very WIP, and I'm not sure the approach I've taken here is the best one, but stage 1 tests pass locally; I believe this is in a good enough state to unleash this upon unsuspecting 3rd-party code, and see what breaks.
2023-07-21 15:00:36 +00:00
..
callbacks.rs Simplify tls::enter_context. 2023-02-09 15:25:45 +11:00
errors.rs Write to stdout if - is given as output file 2023-06-06 17:53:29 -04:00
interface.rs On nightly, dump ICE backtraces to disk 2023-07-19 14:10:07 +00:00
lib.rs Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
passes.rs Remove Queries::ongoing_codegen. 2023-06-21 11:29:45 +10:00
proc_macro_decls.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
queries.rs Avoid Lrc<Box<dyn CodegenBackend>>. 2023-06-22 09:18:09 +10:00
tests.rs Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk 2023-07-21 15:00:36 +00:00
util.rs On nightly, dump ICE backtraces to disk 2023-07-19 14:10:07 +00:00