summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
AgeCommit message (Collapse)AuthorLines
2022-10-29Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errorsGuillaume Gomez-4/+3
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions` This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3 r? `@compiler-errors`
2022-10-28Auto merge of #102674 - CastilloDel:master, r=oli-obkbors-6/+6
Remove allow(rustc::potential_query_instability) in rustc_const_eval The use of FxHashMap has been replaced with FxIndexMap. Related to #84447
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-4/+3
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-26Rollup merge of #103546 - RalfJung:cast, r=oli-obkDylan DPC-31/+30
interpret: a bit of cast cleanup r? `@oli-obk`
2022-10-26Rollup merge of #103428 - SarthakSingh31:issue-94187, r=compiler-errorsDylan DPC-2/+4
Removed verbose printing from the `PrettyPrinter` when printing constants Partially solves #94187 by completing the first step described in [this comment](https://github.com/rust-lang/rust/issues/94187#issuecomment-1282339909).
2022-10-26Auto merge of #103562 - Dylan-DPC:rollup-sheepp5, r=Dylan-DPCbors-4/+4
Rollup of 10 pull requests Successful merges: - #102951 (suggest type annotation for local statement initialed by ref expression) - #103209 (Diagnostic derives: allow specifying multiple alternative suggestions) - #103287 (Use a faster allocation size check in slice::from_raw_parts) - #103416 (Name the `impl Trait` in region bound suggestions) - #103430 (Workaround unstable stmt_expr_attributes for method receiver expressions) - #103444 (Remove extra type error after missing semicolon error) - #103520 (rustc_middle: Rearrange resolver outputs structures slightly) - #103533 (Use &self instead of &mut self for cast methods) - #103536 (Remove `rustc_driver::set_sigpipe_handler()`) - #103542 (Pinning tests for some `macro_rules!` errors discussed in the lang meeting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-26Auto merge of #103279 - compiler-errors:normalize-hack-back, r=lcnrbors-1/+8
Add eval hack in `super_relate_consts` back Partially reverts 01adb7e98d5656c06497f33dd2747df144e78356. This extra eval call *still* needs to happen, for example, in `normalize_param_env_or_error` when a param-env predicate has an unnormalized constant, since the param-env candidates never get normalized during candidate assembly (everywhere else we can assume that they are normalized fully). r? `@lcnr,` though I feel like I've assigned quite a few PRs to you in the last few days, so feel free to reassign to someone else familiar with this code if you're busy! cc #103243 (fixes the issue, but don't want to auto-close that until a backport is performed).
2022-10-25interpret: a bit of cast cleanupRalf Jung-31/+30
2022-10-25Use &self instead of &mut self for cast methodsJannis Christopher Köhl-4/+4
2022-10-25Rollup merge of #103122 - ouz-a:mir-technical-debt, r=oli-obkDylan DPC-20/+43
Remove misc_cast and validate types when casting Continuing our work in #102675 r? ````@oli-obk````
2022-10-25Added helper to prevent verbose printing from the `PrettyPrinter` when ↵Sarthak Singh-2/+4
printing constants
2022-10-23Comment why normalization is needed for debug assertionsMichael Goulet-1/+8
2022-10-23remove misc_cast and validate typesouz-a-20/+43
2022-10-20Rollup merge of #103315 - RalfJung:interpret-switchint-ice, r=bjorn3Matthias Krüger-1/+0
interpret: remove an incorrect assertion This fixes an ICE in Miri, [reported](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/SwitchInt.20with.20no.20targets.3F) by `@saethlin.` The faulty assertion was introduced by https://github.com/rust-lang/rust/commit/432535da2b5144d467056efcfa6864d35ba2de0f, when a previously correct assertion checking that the `otherwise` target exists got replaced by this assertion checking that at least one more target beyond `otherwise` exists. Sadly we don't have a small reproducer so I don't think we can easily add a testcase.
2022-10-20interpret: remove an incorrect assertionRalf Jung-1/+0
2022-10-18Remove allow(rustc::potential_query_instability) in rustc_const_evalCastilloDel-6/+6
The use of FxHashMap has been replaced with FxIndexMap. For more information see https://github.com/rust-lang/rust/issues/84447
2022-10-14more dupe word typosRageking8-1/+1
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-3/+5
2022-10-08Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obkMatthias Krüger-2/+2
Remove `mir::CastKind::Misc` As discussed in #97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ````@oli-obk````
2022-10-07make const_err a hard errorRalf Jung-2/+3
2022-10-06Remove `mir::CastKind::Misc`ouz-a-2/+2
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-3/+3
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-02Don't ICE when trying to copy unsized value in const propMichael Goulet-5/+11
2022-09-29Mark ignore(illustrative) on docs in ↵reez12g-3/+3
compiler/rustc_const_eval/src/interpret/validity.rs
2022-09-26remove cfg(bootstrap)Pietro Albini-3/+1
2022-09-21OpTy: fix a method taking self rather than &selfRalf Jung-1/+1
2022-09-20Rollup merge of #102021 - lcnr:tyConst-fun, r=b-naber,BoxyUwUMichael Howell-44/+35
some post-valtree cleanup r? project-const-generics cc ```@b-naber```
2022-09-20Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebankbors-0/+10
Allow patterns to constrain the hidden type of opaque types fixes #96572 reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864) TODO: * check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-19Rollup merge of #101985 - RalfJung:generate_stacktrace, r=oli-obkMatthias Krüger-2/+9
interpret: expose generate_stacktrace without full InterpCx In Miri we sometimes want to emit diagnostics without having a full `&InterpCx` available. To avoid duplicating code, this adds a way to get a stacktrace from an arbitrary slice of interpreter frames, that Miri can use with access to just a thread manager.
2022-09-19ctfe, `const_to_op` only for mir constantslcnr-44/+35
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+0
2022-09-18interpret: expose generate_stacktrace without full InterpCxRalf Jung-2/+9
2022-09-17Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnrbors-1/+13
Use only ty::Unevaluated<'tcx, ()> in type system r? `@lcnr`
2022-09-16Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, ↵Oli Scherer-0/+10
r=estebank"" This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
2022-09-14address review againb-naber-12/+13
2022-09-13Address code review commentsEric Holk-6/+5
2022-09-13rebaseb-naber-1/+1
2022-09-13fixes/working versionb-naber-1/+1
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-1/+12
2022-09-12Rename some variantsMichael Goulet-1/+1
2022-09-12Construct dyn* during const interpMichael Goulet-1/+12
2022-09-12dyn* through more typechecking and MIREric Holk-0/+4
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-3/+3
2022-09-08bound variables during ctfe are a buglcnr-3/+3
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-7/+9
Fixes #46213
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-5/+5
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-06Move CTFE handling of nondiverging intrinsics to intrinsics.rsOli Scherer-19/+29
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-11/+12
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-6/+9
2022-09-03Add a Machine hook for inline assemblyBen Kimock-2/+21