summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-11-05Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obkMara Bos-3/+9
make intern_const_alloc_recursive return error fix #78655 r? ``@oli-obk``
2020-11-04make intern_const_alloc_recursive return error fix #78655Vishnunarayan K I-3/+9
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-37/+4
2020-11-04Move ZST constant to the top of the impl blockoli-2/+2
2020-11-04Do not raise interp errors from the scalar int moduleoli-2/+8
2020-11-04Add helper for getting an `int` out of a `Scalar`oli-0/+8
2020-11-04Replace `Scalar::zst` with a `Scalar::ZST` constantoli-4/+1
2020-11-04No need for a `zst` constructor method when we can have a constantoli-1/+1
2020-11-04s/Scalar::Raw/Scalar::Intoli-22/+22
2020-11-04Split the "raw integer bytes" part out of `Scalar`Oliver Scherer-87/+22
2020-10-14Remove unused code from rustc_middleest31-9/+0
2020-10-13Replace absolute paths with relative onesest31-3/+3
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-06Rollup merge of #76995 - LingMan:middle_matches, r=varkorYuki Okushi-12/+6
Reduce boilerplate with the matches! macro Replaces simple bool `match`es of the form match $expr { $pattern => true _ => false } and their inverse with invocations of the matches! macro. Limited to rustc_middle for now to get my feet wet.
2020-09-24Auto merge of #77006 - oli-obk:🐌_const_queries, r=Mark-Simulacrumbors-1/+1
Cache `eval_to_allocation_raw` on disk https://github.com/rust-lang/rust/pull/74949#issuecomment-695833161 regressed the performance on these queries, this PR gets the perf back.
2020-09-23Rollup merge of #76939 - lcnr:const-evaluatable-cont, r=oli-obkDylan DPC-0/+6
emit errors during AbstractConst building There changes are currently still untested, so I don't expect this to pass CI :laughing: It seems to me like this is the direction we want to go in, though we didn't have too much of a discussion about this. r? @oli-obk
2020-09-21reviewBastian Kauschke-0/+6
2020-09-21Cache `eval_to_allocation_raw` on diskOliver Scherer-1/+1
2020-09-21Reduce boilerplate with the matches! macroLingMan-12/+6
Replaces simple bool `match`es of the form match $expr { $pattern => true _ => false } and their inverse with invocations of the matches! macro.
2020-09-20Rollup merge of #76891 - lcnr:less-ref, r=ecstatic-morseRalf Jung-9/+9
don't take `TyCtxt` by reference small cleanup
2020-09-20Auto merge of #74949 - oli-obk:validate_const_eval_raw, r=RalfJungbors-17/+17
Validate constants during `const_eval_raw` This PR implements the groundwork for https://github.com/rust-lang/rust/issues/72396 * constants are now validated during `const_eval_raw` * to prevent cycle errors, we do not validate references to statics anymore beyond the fact that they are not dangling * the `const_eval` query ICEs if used on `static` items * as a side effect promoteds are now evaluated to `ConstValue::Scalar` again (since they are just a reference to the actual promoted allocation in most cases).
2020-09-19Reflect the "do not call this query directly" mentality in its nameOliver Scherer-2/+2
2020-09-19Address review commentsOliver Scherer-4/+4
2020-09-19Unify the names of const eval queries and their return typesOliver Scherer-14/+14
2020-09-19Rename const eval queries to reflect the validation changesOliver Scherer-3/+3
2020-09-18don't take `TyCtxt` by referenceBastian Kauschke-9/+9
2020-09-12also assert ScalarMaybeUninit sizeRalf Jung-0/+3
2020-09-04Fix big endian read/writeJubilee Young-6/+12
Co-authored-by: matthewjasper <mjjasper1@gmail.com>
2020-09-04Explain contract of {read, write}_target_uintJubilee Young-0/+6
2020-09-04Be explicit that we're handling bytesJubilee-1/+1
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-09-04Remove reference to byteorder limitsJubilee Young-8/+4
2020-09-04Refactor byteorder to std in rustc_middleJubilee Young-7/+9
Use std::io::{Read, Write} and {to, from}_{le, be}_bytes methods in order to remove byteorder from librustc_middle's dependency graph.
2020-09-02pretty: trim paths of unique symbolsDan Aloni-1/+2
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-30mv compiler to compiler/mark-0/+3007