about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-4/+4
2023-07-05Name the destructure_mir_constant query appropriatelyOli Scherer-2/+2
2023-07-05Use options instead of errors if the errors are never neededOli Scherer-1/+1
2023-07-05Specialize `try_destructure_mir_constant` for its sole userOli Scherer-4/+2
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-0/+3
2023-05-31Remove `deref_mir_constant`Oli Scherer-4/+0
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-06Stabilize is_some_andJonas Platte-1/+0
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-02-27Unify all validity check intrinsicsNilstrieb-2/+2
Also merges the inhabitedness check into the query to further unify the code paths.
2023-02-23Unify validity checks into a single queryNilstrieb-5/+2
Previously, there were two queries to check whether a type allows the 0x01 or zeroed bitpattern. I am planning on adding a further initness to check, truly uninit for MaybeUninit, which would make this three queries. This seems overkill for such a small feature, so this PR unifies them into one.
2023-02-22errors: generate typed identifiers in each crateDavid Wood-0/+4
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-14Make permit_uninit/zero_init fallibleMichael Goulet-6/+3
2023-01-26Auto merge of #105582 - saethlin:instcombine-assert-inhabited, r=cjgillotbors-3/+8
InstCombine away intrinsic validity assertions This optimization (currently) fires 246 times on the standard library. It seems to fire hardly at all on the big crates in the benchmark suite. Interesting.
2023-01-23Thread a ParamEnv down to might_permit_raw_initBen Kimock-3/+8
2023-01-18Also remove `#![feature(control_flow_enum)]` where possibleScott McMurray-1/+0
2023-01-12attempt to make a minimal example workDeadbeef-0/+1
2022-10-18Remove allow(rustc::potential_query_instability) in rustc_const_evalCastilloDel-1/+0
The use of FxHashMap has been replaced with FxIndexMap. For more information see https://github.com/rust-lang/rust/issues/84447
2022-10-05change might_permit_raw_init to fully detect LLVM UB, but not more than thatRalf Jung-4/+2
2022-10-01Change feature name to is_some_andCameron Steffen-1/+1
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-07-17Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obkbors-0/+6
Use constant eval to do strict mem::uninit/zeroed validity checks I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case. Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies. I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally. Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay? Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested. Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-14Use constant eval to do strict validity checks5225225-0/+6
2022-07-08Migrate unstable-in-stable diagnosticMichael Goulet-0/+1
2022-07-03fix interpreter validity check on BoxRalf Jung-0/+1
2022-06-28Improve pretty printing of valtrees for referencesDominik Stolz-1/+0
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-9/+4
2022-06-11Try out `yeet` in the MIR interpreterScott McMurray-0/+1
2022-05-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-0/+1
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+0
2022-05-16use GlobalId in eval_to_valtree query and introduce query for ↵b-naber-8/+14
valtree_to_const_val
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-04-21implement (as of now still unused) query for valtree -> constvalue conversionb-naber-0/+4
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-16Support pretty printing of invalid constantsTomasz Miąsko-2/+2
Make it possible to pretty print invalid constants by introducing a fallible variant of `destructure_const` and falling back to debug formatting when it fails.
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-12-13Remove `in_band_lifetimes` from `rustc_const_eval`LegionMammal978-1/+0
See #91867 for more information.
2021-12-02Reduce boilerplate around infallible foldersAlan Egerton-1/+0
2021-11-26Unwrap the results of type foldersLeSeulArtichaut-0/+1
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-16Adopt let_else across the compilerest31-0/+1
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-1/+0