summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
AgeCommit message (Collapse)AuthorLines
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-15/+13
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
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-17Remove double spaces after dots in commentsMaybe Waffle-25/+25
2023-01-17Self review suggestionsMaybe Waffle-26/+33
- add back accidentally removed new lines - try to deref in patterns, rather than in expressions (maybe this was the reason of perf regression?...)
2023-01-17Review suggestionsMaybe Waffle-3/+3
2023-01-17Undo questionable changesMaybe Waffle-23/+24
2023-01-17`rustc_const_eval`: remove `ref` patterns (+some pattern matching imps)Maybe Waffle-63/+53
2023-01-09Use newtype for unused generic parametersNilstrieb-2/+1
2022-12-22Auto merge of #106054 - matthiaskrgr:rollup-38epsfh, r=matthiaskrgrbors-2/+4
Rollup of 6 pull requests Successful merges: - #105567 (KCFI test: Also support LLVM 16 output) - #105847 (Ensure param-env is const before calling `eval_to_valtree`) - #105983 (Add a missing early return in drop tracking `handle_uninhabited_return`) - #106027 (rustdoc: simplify CSS and DOM for more-scraped-examples) - #106035 (Migrate search tab title color to CSS variable) - #106037 (Add regression test for #94293) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Rollup merge of #105847 - compiler-errors:issue-104396, r=oli-obkMatthias Krüger-2/+4
Ensure param-env is const before calling `eval_to_valtree` Other queries call `ParamEnv::with_const` *inside* of the query itself (e.g. `const_eval_global_id_for_typeck`), so this could alternatively be moved into the provider of `eval_to_valtree` instead. I don't have a particularly strong opinion, though *theoretically* caching is better if we make the query keys more constrained. I'm not exactly sure how this is an effect of the `-Zmir-opt-level=3` flag. Maybe something about the inliner causes us to inline an unevaluated const into a body where it can be evaluated, but where it has not yet been normalized. This seems likely, since we're inlining `from_fn_1::<{ N / 2 }, _>` in `from_fn_2`, which means that we will need to evaluate that constant during the const prop pass after inlining. Fixes #104396
2022-12-22Auto merge of #103957 - JakobDegen:drop-retag, r=RalfJungbors-3/+12
Retag as FnEntry on `drop_in_place` This commit changes the mir drop shim to always retag its argument as if it were a `&mut`. cc rust-lang/unsafe-code-guidelines#373
2022-12-22Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitorbors-6/+17
Rollup of 8 pull requests Successful merges: - #105584 (add assert messages if chunks/windows are length 0) - #105602 (interpret: add read_machine_[ui]size convenience methods) - #105824 (str.lines() docstring: clarify that line endings are not returned) - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - #105986 (Fix typo in reading_half_a_pointer.rs) - #105995 (Add regression test for #96530) - #106008 (Sort lint_groups in no_lint_suggestion) - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-21Don't run `Drop` terminators on types that do not have drop glue in const evalJakob Degen-3/+12
2022-12-22Rollup merge of #105602 - RalfJung:read-convenience, r=oli-obkYuki Okushi-6/+17
interpret: add read_machine_[ui]size convenience methods We have `read_pointer`, so it felt inconsistent to not also have these. r? ```@oli-obk```
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-2/+4
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-18Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obkMatthias Krüger-1/+1
don't destuct references just to reborrow
2022-12-18don't restuct references just to reborrowMatthias Krüger-1/+1
2022-12-18avoid .into() conversion to identical typesMatthias Krüger-9/+6
2022-12-17Ensure param-env is const before calling eval_to_valtreeMichael Goulet-2/+4
2022-12-15Move alignment failure error reporting to machineOli Scherer-40/+10
2022-12-15Make alignment checks a future incompat lintOli Scherer-35/+77
2022-12-15Always pass alignment and handle checking lazilyOli Scherer-9/+17
2022-12-13Combine identical alias armsMichael Goulet-7/+4
2022-12-13Combine projection and opaque into aliasMichael Goulet-4/+4
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-1/+1
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-12-13Rename `assert_uninit_valid` intrinsicNilstrieb-2/+4
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
2022-12-12interpret: add read_machine_[ui]size convenience methodsRalf Jung-6/+17
2022-12-11Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-deadMatthias Krüger-9/+0
compiler: remove unnecessary imports and qualified paths Some of these imports were necessary before Edition 2021, others were already in the prelude. I hope it's fine that this PR is so spread-out across files :/
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-9/+0
2022-12-09Remove unneeded field from `SwitchTargets`Jakob Degen-2/+1
2022-12-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-15/+3
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-15/+3
2022-12-06make retagging work even with 'unstable' placesRalf Jung-6/+49
2022-12-03interpret: clobber return place when calling functionRalf Jung-0/+4
2022-11-28Rollup merge of #104982 - RalfJung:norun, r=oli-obkMatthias Krüger-5/+0
interpret: get rid of run() function Miri needs its own loop anyway, so there's not much of a point in trying to share this code.
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-5/+5
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27interpret: get rid of run() functionRalf Jung-5/+0
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-5/+5
2022-11-27Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnrbors-12/+4
Various cleanups around scalar layout restrictions Pulled out of https://github.com/rust-lang/rust/pull/103724
2022-11-25add FIXME'sBoxy-0/+1
2022-11-25Add empty ConstKind::Abstractkadmin-0/+1
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Move a comment to the right placeOli Scherer-3/+3
2022-11-25`rustc_layout_scalar_valid_range` can be applied to scalar pairs and affects ↵Oli Scherer-9/+1
teh first scalar
2022-11-20Rollup merge of #104564 - RalfJung:either, r=oli-obkMatthias Krüger-55/+65
interpret: use Either over Result when it is not representing an error condition r? `@oli-obk`
2022-11-19constify `exact_div` intrinsicLukas Markeffsky-0/+5
2022-11-19Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errorsDylan DPC-3/+3
nll: correctly deal with bivariance fixes #104409 when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions. r? types cc ``@RalfJung``
2022-11-18review feedbackRalf Jung-7/+7
2022-11-18interpret: use Either over Result when it is not representing an error conditionRalf Jung-55/+65
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-48/+70