about summary refs log tree commit diff
path: root/src/librustc_mir/const_eval
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1212/+0
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-14Rollup merge of #75448 - lcnr:rn-as_local_hir_id, r=davidtwcoTyler Mandry-3/+3
merge `as_local_hir_id` with `local_def_id_to_hir_id` `as_local_hir_id` was defined as just calling `local_def_id_to_hir_id` and I think that having two different ways to call the same method is somewhat confusing. Don't really care about which of these 2 methods we want to keep. Does this require an MCP, considering that these methods are fairly frequently used?
2020-08-14add a FIXME concerning interning of promotedsRalf Jung-0/+6
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-3/+3
2020-08-12fix span of stack size errorRalf Jung-4/+8
2020-08-11Rollup merge of #75338 - RalfJung:const-eval-stack-size-check, r=oli-obkYuki Okushi-0/+9
move stack size check to const_eval machine This is consistent with how we enforce the step limit. In particular, we do not want this limit checked for Miri-the-tool.
2020-08-09move stack size check to const_eval machineRalf Jung-0/+9
2020-08-09move const_eval error reporting logic into rustc_mir::const_eval::errorRalf Jung-17/+162
2020-07-28Replace all uses of `log::log_enabled` with `Debug` printersOliver Scherer-1/+1
2020-07-27Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obkbors-1/+1
Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id We only have to call `extern_static_alloc_id` when a `Pointer` is "imported" from the `tcx` to the machine, not on each access. Also drop the old hook for TLS handling, it is not needed any more. The Miri side of this is at https://github.com/rust-lang/miri/pull/1489. Fixes https://github.com/rust-lang/rust/issues/71194 r? @oli-obk
2020-07-27rename eval_const_to_op -> const_to_opRalf Jung-1/+1
2020-07-22renamed ScalarMaybeUninit::not_undef to check_initPhilippe Nadon-1/+1
Renamed the function ScalarMaybeUninit::not_undef to ScalarMaybeUninit::check_init in the file src/librustc_middle/mir/interpret/value.rs, to reflect changes in terminology used. Related issue rust-lang#71193
2020-07-20mir: `unused_generic_params` queryDavid Wood-1/+1
This commit implements the `unused_generic_params` query, an initial version of polymorphization which detects when an item does not use generic parameters and is being needlessly monomorphized as a result. Signed-off-by: David Wood <david@davidtw.co>
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-3/+2
2020-07-15update promoted_mirBastian Kauschke-1/+1
2020-07-15update const arg queriesBastian Kauschke-1/+2
2020-07-15const generics work!Bastian Kauschke-1/+1
2020-07-15InstanceDef::ItemBastian Kauschke-14/+14
2020-07-10Avoid "whitelist"Tamir Duberstein-1/+1
Other terms are more inclusive and precise.
2020-07-09Rollup merge of #74070 - eddyb:forall-tcx-providers, r=nikomatsakisManish Goregaokar-1/+1
Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. In order to work around normalization-under-HRTB (for `provide!` in `rustc_metadata`), we ended up with this: ```rust struct Providers<'tcx> { type_of: fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` But what I initially wanted to do, IIRC, was this: ```rust struct Providers { type_of: for<'tcx> fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` This PR moves to the latter, for the simple reason that only the latter allows keeping a `Providers` value, or a subset of its `fn` pointer fields, around in a `static` or `thread_local!`, which can be really useful for custom drivers that override queries. (@jyn514 and I came across a concrete usecase of that in `rustdoc`) The `provide!` macro in `rustc_metadata` is fixed by making the query key/value types available as type aliases under `ty::query::query_{keys,values}`, not just associated types (this is the first commit). r? @nikomatsakis
2020-07-06Auto merge of #73978 - Mark-Simulacrum:shrink-paramenv, r=nnethercotebors-5/+5
Shrink ParamEnv to 16 bytes r? @nnethercote x.py check passes but I haven't tried running perf or tests
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-1/+1
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-5/+5
2020-07-04ConstCx to LocalDefIdBastian Kauschke-4/+4
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-16/+11
propagation
2020-06-19pretty/mir: const value enums with no variantsDavid Wood-9/+15
This commit modifies the pretty printer and const eval in the MIR so that `destructure_const` (used in `pretty_print_const_value`) can handle enums with no variants (or types containing enums with no variants). Signed-off-by: David Wood <david@davidtw.co>
2020-06-14keep root_span and tcx togetherRalf Jung-2/+2
2020-06-12avoid computing cur_span all the timeRalf Jung-3/+9
2020-06-12fix const_prop spans and re-bless testsRalf Jung-4/+5
2020-06-12make miri InterpCx TyCtxtAt a TyCtxt, and separately remember the root span ↵Ralf Jung-11/+12
of the evaluation
2020-06-09Fix more clippy warningsMatthias Krüger-3/+1
Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-2/+3
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-24Removed all instances of const_field.Rakshith Ravi-28/+1
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-2/+2
2020-05-10avoid raising interpreter errors from interningRalf Jung-2/+2
2020-05-09Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJungRalf Jung-3/+3
Simplify the `tcx.alloc_map` API This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private. r? @RalfJung
2020-05-08Create a convenience wrapper for `get_global_alloc(id).unwrap()`Oliver Scherer-6/+5
2020-05-08Move `unwrap_fn` and `unwrap_memory` to `GlobalAlloc`Oliver Scherer-3/+9
2020-05-08Simplify the `tcx.alloc_map` APIOliver Scherer-8/+3
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-5/+5
1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-02Rollup merge of #71712 - RalfJung:error-backtrace, r=oli-obkRalf Jung-1/+1
Miri: port error backtraces to std::backtrace No need to pull in an external dependency if libstd already includes this feature (using the same dependency internally, but... still). r? @oli-obk
2020-04-30Miri: port error backtraces to std::backtraceRalf Jung-1/+1
2020-04-28clarify commentRalf Jung-1/+3
2020-04-28better document const-pattern dynamic soundness checks, and fix a soundness holeRalf Jung-2/+9
2020-04-28Rollup merge of #71615 - RalfJung:share-machine-code, r=oli-obkDylan DPC-56/+4
share some common code for compile-time miri instances Fixes https://github.com/rust-lang/rust/issues/71129 r? @oli-obk
2020-04-27Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queriesmarmeladema-3/+5
2020-04-27share some common code for compile-time miri instancesRalf Jung-56/+4
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-1/+1
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-3/+3