about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/intern.rs
AgeCommit message (Collapse)AuthorLines
2025-07-30const-eval: full support for pointer fragmentsRalf Jung-40/+57
2025-07-16simplfy memory kind handling during interningRalf Jung-39/+10
2025-07-16const heap: fix ICE on forgotten make_globalRalf Jung-39/+35
2025-07-16Comment more code and make tests clearerDeadbeef-7/+6
Co-Authored-By: Ralf Jung <post@ralfj.de>
2025-07-16add `const_make_global`; err for `const_allocate` ptrs if didn't callDeadbeef-6/+52
Co-Authored-By: Ralf Jung <post@ralfj.de> Co-Authored-By: Oli Scherer <github333195615777966@oli-obk.de>
2025-06-10const_eval: fix some outdated commentsRalf Jung-8/+7
2025-05-02Move `DisambiguatorState` into `intern_const_alloc_recursive`John Kåre Alsaker-11/+26
2025-05-02Add `DefPathData::NestedStatic` instead of reusing `DefPathData::AnonConst`John Kåre Alsaker-4/+3
2025-04-29Remove global `next_disambiguator` state and handle it with a ↵John Kåre Alsaker-5/+10
`DisambiguatorState` type
2025-04-17`intern_with_temp_alloc` is for `DummyMachine` only.Nicholas Nethercote-2/+6
2025-03-07Pass `Option<Symbol>` to `def_path_data`/`create_def` methods.Nicholas Nethercote-1/+1
It's clearer than using `kw::Empty` to mean `None`.
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-2/+2
2025-02-08Rustfmtbjorn3-5/+5
2024-11-19`InterpCx` store `TypingEnv` instead of a `ParamEnv`lcnr-1/+1
2024-11-19move `fn is_item_raw` to `TypingEnv`lcnr-1/+1
2024-10-01make InterpResult a dedicated type to avoid accidentally discarding the errorRalf Jung-4/+6
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-6/+6
2024-09-10turn errors that should be impossible due to our static checks into ICEsRalf Jung-20/+32
2024-09-10const-eval interning: accpt interior mutable pointers in final value (but ↵Ralf Jung-7/+11
keep rejecting mutable references)
2024-06-13rename CompileTimeInterpreter -> CompileTimeMachine, CompileTimeEvalContext ↵Ralf Jung-1/+1
-> CompileTimeInterpCx to match the terms used in the shared interpreter infrastructure
2024-06-04Add safe/unsafe to static inside extern blocksSantiago Pastorino-1/+1
2024-05-27interpret: get rid of 'mir lifetime everywhereRalf Jung-24/+9
2024-05-27interpret: the MIR is actually at lifetime 'tcxRalf Jung-1/+1
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_const_eval`.Nicholas Nethercote-0/+1
2024-05-13Remove `extern crate rustc_middle` from `rustc_const_eval`.Nicholas Nethercote-1/+1
This requires exporting the interpreter macros so they can be used with `use crate::interpret::*`.
2024-04-17Use less fragile error handlingOli Scherer-15/+11
2024-04-17Validate before reporting interning errors.Oli Scherer-20/+25
validation produces much higher quality errors and already handles most of the cases
2024-04-02Forbid implicit nested statics in thread local staticsOli Scherer-1/+5
2024-03-31Don't inherit codegen attrs from parent staticMichael Goulet-3/+8
2024-03-20Rollup merge of #121543 - onur-ozkan:clippy-args, r=oli-obkMatthias Krüger-1/+3
various clippy fixes We need to keep the order of the given clippy lint rules before passing them. Since clap doesn't offer any useful interface for this purpose out of the box, we have to handle it manually. Additionally, this PR makes `-D` rules work as expected. Previously, lint rules were limited to `-W`. By enabling `-D`, clippy began to complain numerous lines in the tree, all of which have been resolved in this PR as well. Fixes #121481 cc `@matthiaskrgr`
2024-03-20resolve clippy errorsonur-ozkan-1/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-19Ensure nested statics have a HIR node to prevent various queries from ICEingOli Scherer-0/+2
2024-03-14Move only usage of `take_static_root_alloc` to its definition and inline itOli Scherer-1/+1
2024-03-13placate tidy.Felix S. Klock II-1/+1
2024-03-13downgrade mutable-ptr-in-final-value from hard-error to future-incompat lint ↵Felix S. Klock II-4/+8
to address issue 121610.
2024-03-12s/mt/mutability/Oli Scherer-1/+1
2024-03-12Ensure nested allocations in statics do not get deduplicatedOli Scherer-3/+44
2024-02-23compiler: clippy::complexity fixesMatthias Krüger-2/+2
2024-02-15Do not allocate a second "background" alloc id for the main allocation of a ↵Oli Scherer-5/+27
static. Instead we re-use the static's alloc id within the interpreter for its initializer to refer to the `Allocation` that only exists within the interpreter.
2024-02-13Bump `indexmap`clubby789-1/+2
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
2024-02-05Clarify order of operations during interningOli Scherer-0/+7
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-01-29Document base vs nested alloc interningOli Scherer-0/+3
2024-01-29separately intern the outermost alloc from the restOli Scherer-41/+39
2024-01-29Prefer external iteration now that we don't actually recurse anymoreOli Scherer-22/+16
2024-01-22reword commentRalf Jung-7/+10
2024-01-22const-eval interner: from-scratch rewrite using mutability information from ↵Ralf Jung-407/+150
provenance rather than types
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-5/+5
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-11/+13
is immutable
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-4/+4
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.