about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/util.rs
AgeCommit message (Collapse)AuthorLines
2025-09-09allow `#[rustc_align_static(N)]` on `static`sFolkert de Vries-2/+9
We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.
2025-08-11Turn _span into _trace as trace span nameStypox-7/+7
_span could possibly be confused with the Span type in rustc
2025-07-31Add EnteredTraceSpan::or_if_tracing_disabledStypox-4/+31
2025-07-31Make Miri's enter_trace_span! call const_eval'sStypox-4/+4
2025-07-31Uniform enter_trace_span! and add documentationStypox-2/+61
The macro was uniformed between rustc_const_eval and miri
2025-07-08Make enter_trace_span take a closure for better optimizationStypox-1/+1
2025-07-08Replace TRACING_ENABLED with enter_trace_span()Stypox-12/+11
Hopefully this will make tracing calls be optimized out properly when tracing is disabled
2025-06-11Fix enter_trace_span!() using wrong $crate pathsStypox-2/+2
2025-05-26extend allocbytes with associated typeNia Espera-1/+1
2025-05-20Add enter_trace_span!() that checks if tracing is enabledStypox-0/+19
2025-02-11fix ensure_monomorphic_enoughLukas Markeffsky-41/+3
2025-01-28miri: optimize zeroed allocSpecificProtagonist-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-06Remove polymorphizationBen Kimock-28/+6
2024-10-01make InterpResult a dedicated type to avoid accidentally discarding the errorRalf Jung-4/+4
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-13interpret: simplify SIMD type handlingRalf Jung-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-1/+1
2024-06-13rename CompileTimeInterpreter -> CompileTimeMachine, CompileTimeEvalContext ↵Ralf Jung-3/+3
-> CompileTimeInterpCx to match the terms used in the shared interpreter infrastructure
2024-05-27interpret: get rid of 'mir lifetime everywhereRalf Jung-4/+4
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-2/+1
This requires exporting the interpreter macros so they can be used with `use crate::interpret::*`.
2024-03-14Move the entire success path into `eval_body_using_ecx`Oli Scherer-1/+1
2024-03-14Move InterpCx into eval_in_interpreterOli Scherer-1/+1
2024-03-14Move only usage of `take_static_root_alloc` to its definition and inline itOli Scherer-8/+13
2024-03-12Ensure nested allocations in statics do not get deduplicatedOli Scherer-5/+5
2024-03-05Convert `TypeVisitor` and `DefIdVisitor` to use `VisitorResult`Jason Newcomb-3/+3
2024-02-15Do not allocate a second "background" alloc id for the main allocation of a ↵Oli Scherer-1/+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-12Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obkMatthias Krüger-7/+7
Dejargonize `subst` In favor of #110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
2024-02-12Dejargnonize substShoyu Vanilla-7/+7
2024-02-11Fix async closures in CTFEMichael Goulet-0/+1
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-09-26subst -> instantiatelcnr-2/+3
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4/+4
2023-04-27rename `needs_subst` to `has_param`Boxy-3/+3
2023-04-20Remove WithOptconstParam.Camille GILLOT-1/+1
2023-02-22Remove type-traversal trait aliasesAlan Egerton-2/+4
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-2/+2
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-09Use newtype for unused generic parametersNilstrieb-2/+1
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-07-06Update TypeVisitor pathsAlan Egerton-3/+1
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+4
2022-06-30Don't assert polymorphization has taken effect in const evalWesley Wiser-16/+4
Const eval no longer runs MIR optimizations so unless this is getting run as part of a MIR optimization like const-prop, there can be unused type parameters even if polymorphization is enabled.
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-2/+2
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-08Folding revamp.Nicholas Nethercote-2/+2
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+1