about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-11-25bring back MemoryExtraRalf Jung-7/+26
2018-11-25Auto merge of #55959 - matthewjasper:remove-end-region, r=nikomatsakisbors-1/+0
Cleanup from lexical MIR borrowck removal Lexical MIR borrowck was removed months ago now, and `EndRegion`s are no longer used for MIRI verification. * Remove `rustc::mir::StatementKind::EndRegion` and the `-Zemit_end_regions` flag * Use `RegionVid` instead of `Region` in BorrowSet * Rewrite drop generation to create fewer goto terminators. r? @nikomatsakis
2018-11-24Rebase falloutOliver Scherer-8/+23
2018-11-24Explain why vtable generation needs no alignment checksOliver Scherer-0/+3
2018-11-24Factor out mplace offsetting into its own methodOliver Scherer-22/+31
2018-11-24tidyOliver Scherer-1/+2
2018-11-24Array and slice projections need to update the place alignmentOliver Scherer-8/+11
2018-11-24comment nitRalf Jung-1/+1
Co-Authored-By: oli-obk <github35764891676564198441@oli-obk.de>
2018-11-24Use correct alignment checks for scalars and zsts, tooOliver Scherer-2/+2
2018-11-24Use correct alignment for fat pointer extra partOliver Scherer-1/+1
2018-11-24Move alignment checks out of `Allocation`Oliver Scherer-28/+31
2018-11-24Explain early abort legalityOliver Scherer-0/+1
2018-11-24Rebase falloutOliver Scherer-1/+1
2018-11-24Clean up array/slice of primitive validationOliver Scherer-13/+10
2018-11-24Reintroduce zst-slice reading `read_bytes` method on `Memory`Oliver Scherer-4/+17
2018-11-24Remove unnecessary `Result` (function always returned `Ok`)Oliver Scherer-1/+1
2018-11-24Adjust rustc_mir::interpret to changes in `Allocation`/`Memory` methodsOliver Scherer-33/+77
2018-11-24Move some byte and scalar accessors from `Memory` to `Allocation`Oliver Scherer-197/+0
2018-11-24Move alignment and bounds check from `Memory` to `Allocation`Oliver Scherer-42/+0
2018-11-24Move undef mask methods from `Memory` to `Allocation`Oliver Scherer-29/+0
2018-11-24Move relocation methods from `Memory` to `Allocation`Oliver Scherer-73/+0
2018-11-24Move some methods from `Memory` to `Allocation`Oliver Scherer-84/+0
2018-11-24Rollup merge of #56022 - RalfJung:validate-before-jump, r=oli-obkkennytm-7/+14
When popping in CTFE, perform validation before jumping to next statement to have a better span for the error Currently, when validating the return value fails, the span points at the next statement after the call. That does not make much sense. r? @oli-obk
2018-11-22miri: restrict fn argument punning to Rust ABIRalf Jung-12/+21
2018-11-22drop glue takes in mutable references, it should reflect that in its typeRalf Jung-0/+3
2018-11-22rustc_target: avoid using AbiAndPrefAlign where possible.Eduard-Mihai Burtescu-80/+76
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-25/+28
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-50/+52
2018-11-20treat generator fields like unionsRalf Jung-2/+22
2018-11-20fix commentRalf Jung-1/+0
2018-11-20generator fields are not necessarily initializedRalf Jung-11/+22
2018-11-20Grammar nitOliver Scherer-1/+1
2018-11-20Document runtime static mutation checksOliver Scherer-1/+2
2018-11-19explain why we can use rawRalf Jung-0/+4
2018-11-19use RawConst in miriRalf Jung-34/+18
2018-11-19Make const_eval_raw query return just an AllocIdRalf Jung-14/+23
2018-11-19Also catch static mutation at evaluation timeOliver Scherer-4/+4
2018-11-19Rollup merge of #56059 - alexcrichton:fix-tests, r=sfacklerkennytm-4/+26
Increase `Duration` approximate equal threshold to 1us Previously this threshold when testing was 100ns, but the Windows documentation states: > which is a high resolution (<1us) time stamp which presumably means that we could have up to 1us resolution, which means that 100ns doesn't capture "equivalent" time intervals due to various bits of rounding here and there. It's hoped that this.. Closes #56034
2018-11-19Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obkPietro Albini-12/+3
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-18Rollup merge of #55916 - RalfJung:mut-visitor, r=oli-obkPietro Albini-16/+23
Make miri value visitor usfeful for mutation ~~This is based on top of https://github.com/rust-lang/rust/pull/55716, [click here](https://github.com/RalfJung/rust/compare/escape-to-raw...RalfJung:mut-visitor) for just the new commits.~~ r? @oli-obk
2018-11-18Rollup merge of #55894 - RalfJung:validation-enums, r=oli-obkPietro Albini-39/+49
miri enum discriminant handling: Fix treatment of pointers, better error when it is undef r? @oli-obk
2018-11-18Auto merge of #55672 - RalfJung:miri-extern-types, r=eddybbors-4/+26
miri: accept extern types in structs if they are the only field Fixes https://github.com/rust-lang/rust/issues/55541 Cc @oli-obk @eddyb https://github.com/rust-lang/rust/issues/43467
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-1/+0
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-17deallocate locals before validation, to catch dangling referencesRalf Jung-11/+19
2018-11-17When popping in CTFE, perform validation before jumping to next statement to ↵Ralf Jung-17/+16
have a better span for the error
2018-11-17erase the tag on casts involving (raw) pointersRalf Jung-7/+13
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-15do not accept out-of-bounds pointers in enum discriminants, they might be NULLRalf Jung-35/+43
2018-11-15validation: better error when the enum discriminant is UndefRalf Jung-5/+7
2018-11-15rename FrameInfo span field to call_siteRalf Jung-1/+1