summary refs log tree commit diff
path: root/src/librustc_mir/const_eval
AgeCommit message (Collapse)AuthorLines
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
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-4/+3
2020-04-22Don't use `*` for deref-coercionDylan MacKenzie-1/+1
2020-04-19Auto merge of #70598 - vakaras:add-threads-cr3, r=oli-obk,RalfJungbors-7/+25
Make the necessary changes to support concurrency in Miri. This pull request makes the necessary changes to the Rust compiler to allow Miri to support concurrency: 1. Move stack from the interpretation context (`InterpCx`) to machine, so that the machine can switch the stacks when it changes the thread being executed. 2. Add the callbacks that allow the machine to generate fresh allocation ids for each thread local allocation and to translate them back to original allocations when needed. This allows the machine to ensure the property that allocation ids are unique, which allows using a simpler representation of the memory. r? @oli-obk cc @RalfJung
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-1/+1
2020-04-17Rollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obkDylan DPC-17/+10
Use query to determine whether function needs const checking Resolves #69615. The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account. r? @oli-obk
2020-04-16Move stack access methods in the Machine implementations out of the enforce_ ↵Vytautas Astrauskas-14/+14
method group.
2020-04-16mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.Eduard-Mihai Burtescu-10/+6
2020-04-15Make the necessary changes to support concurrency in Miri.Vytautas Astrauskas-7/+25
2020-04-15Rollup merge of #71100 - RalfJung:miri-frame-hook, r=oli-obkMazdak Farrokhzad-23/+29
Miri: expand frame hooks This is needed to make https://github.com/rust-lang/miri/pull/1330 work. r? @oli-obk @eddyb
2020-04-14Rollup merge of #70947 - RalfJung:ctfe-no-read-mut-global, r=oli-obkDylan DPC-8/+23
tighten CTFE safety net for accesses to globals Previously, we only rejected reading from all statics. Now we also reject reading from any mutable global. Mutable globals are the true culprit here as their run-time value might be different from their compile-time values. Statics are just the approximation we use for that so far. Also refactor the code a bit to make it clearer what is being checked and allowed. r? @oli-obk
2020-04-13fmtRalf Jung-2/+3
2020-04-13Miri: let machine hook dynamically decide about alignment checksRalf Jung-3/+6
2020-04-13add after_stack_push hook; add public ImmTy::from_immediate method, and make ↵Ralf Jung-19/+21
ImmTy::imm field private
2020-04-13Miri: let push_frame hook also access and mutate the rest of the frame dataRalf Jung-4/+7
2020-04-10librustc_middle: return LocalDefId instead of DefId in get_parent_didmarmeladema-5/+1
2020-04-10assert that only statics can possibly be mutableRalf Jung-8/+8
2020-04-09Avoid calling `fn_sig` query during `is_const_fn_raw`Dylan MacKenzie-17/+10
2020-04-09tighten CTFE safety net for accesses to globalsRalf Jung-8/+23
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-4/+5
2020-03-30remove a dead parameter that everyone sets to NoneRalf Jung-1/+1
2020-03-30stop unnecessarily passing around span argument for Miri function callsRalf Jung-7/+4
2020-03-30remove caller span from Miri stack frameRalf Jung-1/+0
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-4/+4
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-19/+19
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-29Use `&` to do deref coercion for `ReadOnlyBodyAndCache`Dylan MacKenzie-1/+1
2020-03-26Rollup merge of #70385 - RalfJung:miri-nits, r=eddybMazdak Farrokhzad-4/+4
Miri nits: comment and var name improvement r? @eddyb
2020-03-25miri: avoid a bunch of casts by offering usized-based field indexingRalf Jung-4/+7
2020-03-25rename def_id -> static_def_idRalf Jung-3/+3
2020-03-25better explain GLOBAL_KIND choiceRalf Jung-1/+1
2020-03-24fix const_prop ICERalf Jung-5/+4
2020-03-24get back the more precise error messageRalf Jung-2/+6