summary refs log tree commit diff
path: root/src/librustc/mir/interpret/error.rs
AgeCommit message (Collapse)AuthorLines
2019-07-02Auto merge of #61871 - Zoxc:no-lift-branch, r=eddybbors-0/+4
Don't use lift to detect local types This overlaps with https://github.com/rust-lang/rust/pull/61392. r? @eddyb
2019-06-30Clean up query cache codeJohn Kåre Alsaker-1/+1
2019-06-26Don't use lift to detect local typesJohn Kåre Alsaker-0/+4
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-6/+6
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-13/+8
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-5/+5
2019-06-08rename EvalResult -> InterpResult and EvalError -> InterpErrorInfoRalf Jung-6/+6
2019-06-07add doc comment for EvalErrorRalf Jung-0/+5
2019-06-07make the backtrace field of EvalError privateRalf Jung-1/+1
This also makes sure people don't contruct these the wrong way
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-3/+4
2019-05-27Auto merge of #59627 - ↵bors-10/+6
LooMaclin:issue_57128_improve_miri_error_reporting_in_check_in_alloc, r=RalfJung Improve miri error reporting in check_in_alloc Fixes https://github.com/rust-lang/rust/issues/57128 r? @RalfJung @oli-obk
2019-05-25Don't use `ty::Const` without immediately interningOliver Scherer-1/+1
2019-04-23Improve miri's error reporting in check_in_allocLooMaclin-1/+1
2019-04-20improve docsRalf Jung-2/+2
2019-04-19add Miri error variant for process exitRalf Jung-0/+8
2019-04-19Improve miri's error reporting in check_in_allocLooMaclin-3/+3
2019-04-19Improve miri's error reporting in check_in_allocLooMaclin-1/+1
2019-04-05remove lookup_char_pos_adjAleksey Kladov-2/+2
It is now exactly equivalent to lookup_char_pos.
2019-04-02Merge branch 'master' into ↵Loo Maclin-15/+15
issue_57128_improve_miri_error_reporting_in_check_in_alloc
2019-04-02Improve miri's error reporting in check_in_allocLooMaclin-8/+4
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-15/+15
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-1/+3
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-0/+11
2019-03-13Use derive macro for HashStableJohn Kåre Alsaker-3/+4
2019-02-24hir: remove NodeId from Blockljedrz-7/+7
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-2/+2
2019-02-05move librustc to 2018Mark Mansi-8/+8
2019-01-01`<&'tcx ty::Const as Deref>::deref`Oliver Scherer-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-11miri: use backtrace crate printing instead of rolling our ownRalf Jung-40/+4
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
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-22rustc_target: avoid using AbiAndPrefAlign where possible.Eduard-Mihai Burtescu-6/+6
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-3/+4
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-4/+4
2018-11-19Make const_eval_raw query return just an AllocIdRalf Jung-1/+2
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-5/+9
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-05fix validation error on non-integer enum discriminantsRalf Jung-2/+2
2018-10-28always print backtrace when CTFE_BACKTRACE is setRalf Jung-2/+2
No point in making the user also enable RUST_LOG
2018-10-28remove some unused CTFE error variantsRalf Jung-50/+1