about summary refs log tree commit diff
path: root/src/librustc/mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-12-03s/AllocType/AllocKind/Oliver Scherer-15/+15
2018-12-03s/AllocKind/AllocDiscriminant/Oliver Scherer-11/+11
2018-12-03Document `AllocMap`Oliver Scherer-2/+20
2018-12-03Function pointers are only equal to themselves, not to other function ↵Oliver Scherer-5/+8
pointers to the same function
2018-12-03Monomorphize `AllocType`Oliver Scherer-7/+7
2018-12-03Monomorphize `AllocMap` structOliver Scherer-11/+10
2018-12-03provide a way to replace the tag in a Scalar/MemPlaceRalf Jung-0/+8
2018-11-27Auto merge of #56094 - RalfJung:memory-data-revived, r=oli-obkbors-99/+151
miri: Memory data revived, Hooks for stack frame push/pop r? @oli-obk
2018-11-26Auto merge of #56070 - oli-obk:const_let, r=eddybbors-0/+3
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
2018-11-25TypoOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+1
Co-Authored-By: RalfJung <post@ralfj.de>
2018-11-25fix length of slice returned from read_c_strRalf Jung-3/+5
2018-11-25yay for NLLRalf Jung-5/+3
2018-11-25read_c_str should call the AllocationExtra hooksRalf Jung-4/+3
2018-11-25TypoOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+1
Co-Authored-By: RalfJung <post@ralfj.de>
2018-11-25make memory allocation hook infallibleRalf Jung-3/+3
2018-11-25bring back MemoryExtraRalf Jung-99/+151
2018-11-24Rebase falloutOliver Scherer-12/+20
2018-11-24Document `Allocation`Oliver Scherer-2/+17
2018-11-24Explain {read,write}_scalar failure to cope with zstsOliver Scherer-0/+10
2018-11-24Move alignment checks out of `Allocation`Oliver Scherer-57/+12
2018-11-24Reorder methods in `allocation.rs`Oliver Scherer-85/+85
2018-11-24Make a method that doesn't need `Self` a free function insteadOliver Scherer-18/+17
2018-11-24Make zst accesses in allocations take the regular path.Oliver Scherer-21/+0
Speeding up zst accesses should be done on a higher level.
2018-11-24Remove unnecessary `Result` (function always returned `Ok`)Oliver Scherer-6/+6
2018-11-24Adjust rustc_mir::interpret to changes in `Allocation`/`Memory` methodsOliver Scherer-43/+69
2018-11-24Move some byte and scalar accessors from `Memory` to `Allocation`Oliver Scherer-0/+200
2018-11-24Fiddle a `HasDataLayout` through the allocation methodsOliver Scherer-19/+41
2018-11-24Access `self` instead of `alloc`Oliver Scherer-30/+14
2018-11-24Adjust generics to `Allocation` parametersOliver Scherer-9/+9
2018-11-24Move alignment and bounds check from `Memory` to `Allocation`Oliver Scherer-0/+45
2018-11-24Move undef mask methods from `Memory` to `Allocation`Oliver Scherer-0/+33
2018-11-24Move relocation methods from `Memory` to `Allocation`Oliver Scherer-0/+73
2018-11-24Preliminary code adjustment to let the compiler complain about missing methodsOliver Scherer-4/+4
2018-11-24Move some methods from `Memory` to `Allocation`Oliver Scherer-0/+84
2018-11-22rustc_target: avoid using AbiAndPrefAlign where possible.Eduard-Mihai Burtescu-11/+11
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-5/+6
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-9/+9
2018-11-19Make const_eval_raw query return just an AllocIdRalf Jung-6/+16
2018-11-19Also catch static mutation at evaluation timeOliver Scherer-0/+3
2018-11-19Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obkPietro Albini-12/+43
Miri backtrace improvements Nicer pretty-printing of the `RUST_CTFE_BACKTRACE`-backtraces: ``` 0: backtrace::backtrace::libunwind::trace::hc410fcb66fe85b11 at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/libunwind.rs:53 backtrace::backtrace::trace::h2106294a22648407 at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/mod.rs:42 1: backtrace::capture::Backtrace::new_unresolved::h5d8d98b993d092ba at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/capture.rs:88 2: <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx, u64>>>::from::h6355269b2a661412 at librustc/mir/interpret/error.rs:236 3: <T as core::convert::Into<U>>::into::h70fcb917509539bd at /home/r/src/rust/rustc.2/src/libcore/convert.rs:455 4: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::emulate_foreign_item::h9cde0e3ce7455a4a at src/fn_call.rs:292 5: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::find_fn::h83f89524b9d1a49a at src/fn_call.rs:74 6: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'a, 'mir, 'tcx>>::find_fn::hf9980473c4775f0c at src/lib.rs:345 rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call::h401dec4a687f96e9 at /home/r/src/rust/rustc.2/src/librustc_mir/interpret/terminator.rs:285 ``` Indentation is now consistent with `RUST_BACKTRACE`, and the frame number is not repeated when there are multiple symbols for a frame. Also preserve the `ty::Instance` for the internal backtrace (showing which frames in the user code where on the interpreter stack when the error happened), used by miri to avoid printing spans for libstd internals: ``` error[E0080]: constant evaluation error: the evaluated program panicked --> /home/r/src/rust/rustc.2/src/libstd/panicking.rs:525:9 | 525 | __rust_start_panic(obj as usize) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked | = note: inside call to `std::panicking::rust_panic` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:496:5 = note: inside call to `std::panicking::rust_panic_with_hook` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:390:5 = note: inside call to `std::panicking::continue_panic_fmt` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:345:5 note: inside call to `std::rt::begin_panic_fmt` at <::std::macros::panic macros>:8:1 --> tests/compile-fail/panic.rs:4:5 | 4 | assert_eq!(5, 6); | ^^^^^^^^^^^^^^^^^ = note: inside call to `main` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:34 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:75 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/sys_common/backtrace.rs:136:5 = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1913 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:13 = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:310:40 = note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:306:5 = note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/src/rust/rustc.2/src/libstd/panic.rs:398:9 = note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:58:25 = note: inside call to `std::rt::lang_start_internal` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:5 = note: inside call to `std::rt::lang_start::<()>` ``` Also notice that we show filenames and line numbers here now. r? @oli-obk
2018-11-15do not accept out-of-bounds pointers in enum discriminants, they might be NULLRalf Jung-6/+18
2018-11-15validation: better error when the enum discriminant is UndefRalf Jung-2/+2
2018-11-15rename FrameInfo span field to call_siteRalf Jung-4/+4
2018-11-14put file and line into miri backtraceRalf Jung-3/+8
2018-11-14prettier miri backtrace printingRalf Jung-3/+10
2018-11-14miri: backtraces with instancesRalf Jung-7/+26
2018-11-12for uniformity, also move memory_deallocated to AllocationExtraRalf Jung-0/+11
2018-11-08Rebase falloutOliver Scherer-2/+2
2018-11-08Give `AllocationExtra`s access to their entire `Allocation`Oliver Scherer-6/+2
2018-11-08FalloutOliver Scherer-4/+7