about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-09-26Apply cfg(bootstrap) replacementMark Rousskov-1/+0
2025-08-07Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-SimulacrumStuart Cook-1/+1
Stabilize `strict_overflow_ops` Closes rust-lang/rust#118260
2025-08-04add `project_fields` helper functionWaffle Lapkin-0/+1
2025-07-30Stabilize strict_overflow_opsNurzhan Sakén-1/+1
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-1/+0
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-0/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-07Increase recursion_limit in numerous crates.Nicholas Nethercote-0/+1
This is temporarily needed for `x doc compiler` to work. They can be removed once the `Nonterminal` is removed (#124141).
2025-02-05Pretty print pattern type values with `transmute` if they don't satisfy ↵Oli Scherer-0/+2
their pattern
2025-02-03Refactor using the type-level constant value `ty::Value`FedericoBruzzone-8/+2
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2025-01-30introduce `ty::Value`Lukas Markeffsky-2/+7
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2024-11-30report UB when the niche value refers to the untagged variantRalf Jung-0/+1
2024-11-19`InterpCx` store `TypingEnv` instead of a `ParamEnv`lcnr-4/+3
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-1/+1
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-1/+0
2024-10-15update bootstrap configsJosh Stone-2/+2
2024-09-23fix unqualified_local_imports in rustc_const_evalRalf Jung-1/+4
2024-09-03Add `warn(unreachable_pub)` to `rustc_const_eval`.Nicholas Nethercote-0/+1
2024-08-14stabilize `is_none_or`Slanterns-1/+0
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-12use is_none_or in some places in the compilerRalf Jung-0/+1
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-3/+5
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-05-24compiler: unnest rustc_const_eval::check_constsJubilee Young-1/+1
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_const_eval`.Nicholas Nethercote-3/+0
2024-05-21Remove erroneous comment.Nicholas Nethercote-6/+0
The comment was originally in `src/librustc_mir/lib.rs`, but now that it's in `compiler/rustc_const_eval/src/lib.rs` it's no longer appropriate.
2024-05-13Remove `extern crate rustc_middle` from `rustc_const_eval`.Nicholas Nethercote-2/+0
This requires exporting the interpreter macros so they can be used with `use crate::interpret::*`.
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-03-26Auto merge of #111769 - saethlin:ctfe-backtrace-ctrlc, r=RalfJungbors-0/+7
Print a backtrace in const eval if interrupted Demo: ```rust #![feature(const_eval_limit)] #![const_eval_limit = "0"] const OW: u64 = { let mut res: u64 = 0; let mut i = 0; while i < u64::MAX { res = res.wrapping_add(i); i += 1; } res }; fn main() { println!("{}", OW); } ``` ``` ╭ ➜ ben@archlinux:~/rust ╰ ➤ rustc +stage1 spin.rs ^Cerror[E0080]: evaluation of constant value failed --> spin.rs:8:33 | 8 | res = res.wrapping_add(i); | ^ Compilation was interrupted note: erroneous constant used --> spin.rs:15:20 | 15 | println!("{}", OW); | ^^ note: erroneous constant used --> spin.rs:15:20 | 15 | println!("{}", OW); | ^^ | = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. ```
2024-03-22Add `tag_for_variant` queryJack Wrenn-0/+1
This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. Also moves `DummyMachine` to `rustc_const_eval`.
2024-03-17Print a backtrace in const eval if interruptedBen Kimock-0/+7
2024-03-09interpret: ensure that Place is never used for a different frameRalf Jung-0/+1
2024-02-16Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnaybors-0/+1
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
2024-02-15Return ConstAllocation from eval_static_initializer query directlyOli Scherer-7/+1
2024-02-15Store static initializers in metadata instead of the MIR of statics.Oli Scherer-2/+2
2024-02-15Add new query just for static initializersOli Scherer-0/+7
2024-02-15Use generic `NonZero` internally.Markus Reiter-0/+1
2024-02-06Invert diagnostic lints.Nicholas Nethercote-1/+1
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-25Remove unused featuresclubby789-7/+0
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-2/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-01Rename hook.Camille GILLOT-2/+2
2023-10-31Turn const_caller_location from a query to a hookOli Scherer-1/+1
2023-10-28interpret: call caller_location logic the same way codegen does, and share ↵Ralf Jung-1/+1
some code
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+3
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-09-22Have a single struct for queries and hookOli Scherer-4/+3