about summary refs log tree commit diff
path: root/src/librustc_middle/mir/interpret/error.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-474/+0
2020-08-14Rework `rustc_serialize`Matthew Jasper-2/+2
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-08-09move const_eval error reporting logic into rustc_mir::const_eval::errorRalf Jung-167/+2
2020-08-03Auto merge of #75055 - cjgillot:clean-cache, r=oli-obkbors-1/+1
Introduce an abstraction for EvaluationCache and SelectionCache The small duplicated code has been moved to librustc_query_system. The remaining changes are some cleanups of structural impls.
2020-08-03Use more appropriate `tls::with_*` methods in some places.Nicholas Nethercote-3/+3
2020-08-02Use Lift derive proc-macro in librustc_traits.Camille GILLOT-1/+1
2020-07-26typos + fmtRalf Jung-3/+1
2020-07-26Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id which ↵Ralf Jung-4/+4
is called only when a pointer is 'imported' into the machine
2020-06-19Rollup merge of #72497 - RalfJung:tag-term, r=oli-obkRalf Jung-3/+3
tag/niche terminology cleanup The term "discriminant" was used in two ways throughout the compiler: * every enum variant has a corresponding discriminant, that can be given explicitly with `Variant = N`. * that discriminant is then encoded in memory to store which variant is active -- but this encoded form of the discriminant was also often called "discriminant", even though it is conceptually quite different (e.g., it can be smaller in size, or even use niche-filling). After discussion with @eddyb, this renames the second term to "tag". The way the tag is encoded can be either `TagEncoding::Direct` (formerly `DiscriminantKind::Tag`) or `TagEncoding::Niche` (formerly `DiscrimianntKind::Niche`). This finally resolves some long-standing confusion I had about the handling of variant indices and discriminants, which surfaced in https://github.com/rust-lang/rust/pull/72419. (There is also a `DiscriminantKind` type in libcore, it remains unaffected. I think this corresponds to the discriminant, not the tag, so that seems all right.) r? @eddyb
2020-06-01test miri-unleash TLS accessesRalf Jung-2/+2
2020-06-01Auto merge of #71192 - oli-obk:eager_alloc_id_canonicalization, r=wesleywiserbors-0/+3
Make TLS accesses explicit in MIR r? @rust-lang/wg-mir-opt cc @RalfJung @vakaras for miri thread locals cc @bjorn3 for cranelift fixes #70685
2020-05-30miri errors: rename InvalidDiscriminant -> InvalidTagRalf Jung-3/+3
2020-05-30Make TLS accesses explicit in MIROliver Scherer-0/+3
2020-05-25Miri: refactor read_discriminant and make it return ScalarRalf Jung-2/+2
2020-05-15InvalidUninitBytes: Track more info about accessDavid Cook-6/+33
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-06properly catch invalid-drop-fn errorsRalf Jung-8/+12
2020-05-06validation: port more checks to the pattern-based macro (and give it the ↵Ralf Jung-0/+5
shorter name)
2020-05-02Rollup merge of #71712 - RalfJung:error-backtrace, r=oli-obkRalf Jung-11/+9
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-05-01fix Miri error message paddingRalf Jung-2/+2
2020-05-01use hex for invalid bool and char (consistently with validation)Ralf Jung-2/+6
2020-05-01rename InvalidIntPtrUsageRalf Jung-10/+40
2020-05-01InterpError printing really is more Display than DebugRalf Jung-30/+27
also tweak InvalidDiscriminant message
2020-05-01tweak InvalidIntPointerUsage messageRalf Jung-2/+2
2020-04-30Miri: port error backtraces to std::backtraceRalf Jung-11/+9
2020-04-30Address review commentsOliver Scherer-4/+2
2020-04-30Highlight an error that can only happen in CTFEOliver Scherer-1/+1
2020-04-30Separate miri/ctfe unsupported operationsOliver Scherer-0/+2
2020-04-26Rollup merge of #71569 - samrat:miri-ub-on-size-mismatch, r=RalfJungDylan DPC-0/+10
[miri] Throw UB if target size and data size don't match Issue: https://github.com/rust-lang/miri/issues/1355 If an extern C function is defined as ``` extern "C" { fn malloc(size: u32) -> *mut std::ffi::c_void; } ``` on a 64-bit machine(ie. pointer sizes don't match), return undefined behaviour from Miri when [converting the argument into machine_usize](https://github.com/rust-lang/miri/blob/master/src/shims/foreign_items.rs#L200)
2020-04-26Adjust styleRalf Jung-1/+1
2020-04-26Rename ArgumentSizeMismatch to ScalarSizeMismatchSamrat Man Singh-3/+3
2020-04-26[miri] Throw UB if target size and data size don't matchSamrat Man Singh-0/+10
If an extern C function is defined as ``` extern "C" { fn malloc(size: u32) -> *mut std::ffi::c_void; } ``` on a 64-bit machine(ie. pointer sizes don't match), throw an undefined behaviour.
2020-04-24Replace filter_map().next() calls with find_map()Josh Stone-2/+1
These are semantically the same, but `find_map()` is more concise.
2020-04-20Treat RETURN_PLACE as a normal LocalJonas Schievink-3/+0
Copy its value to the `return_place` upon leaving a call frame
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-32/+25
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it. By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output). This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now. r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
2020-04-16bikeshedRalf Jung-2/+2
2020-04-16mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.Eduard-Mihai Burtescu-32/+25
2020-04-16Miri error messages: avoid try terminologyRalf Jung-4/+4
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-1/+2
2020-03-31const backtrace: do not skip first frameRalf Jung-4/+5
2020-03-30Miri stacktrace: record span inside frame, not call-site spanRalf Jung-13/+8
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-0/+577