about summary refs log tree commit diff
path: root/src/librustc/mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-28move ZST assertion up, for better errorsRalf Jung-2/+2
2020-02-28remove ScalarMaybeUndef::to_bits and make Scalar::to_bits privateRalf Jung-9/+4
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-28remove check_raw after reducing it to one use onlyRalf Jung-8/+3
2020-02-28get rid of to_ptrRalf Jung-11/+3
2020-02-28add comment to check_dataRalf Jung-0/+4
2020-02-28Auto merge of #68505 - skinny121:canonicalize-const-eval-inputs, r=nikomatsakisbors-19/+17
Canonicalize inputs to const eval where needed Canonicalize inputs to const eval, so that they can contain inference variables. Which enables invoking const eval queries even if the current param env has inference variable within it, which can occur during trait selection. This is a reattempt of #67717, in a far less invasive way. Fixes #68477 r? @nikomatsakis cc @eddyb
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-1/+1
example: let s: String = format!("hello").into();
2020-02-24don't explicitly compare against true or falseMatthias Krüger-1/+1
2020-02-20lit_to_const: gracefully bubble up type errors.Mazdak Farrokhzad-0/+4
2020-02-20Erase regions before before performing const eval, to improve caching.Ben Lewis-19/+17
2020-02-16Code review changes.Ben Lewis-3/+8
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-2/+34
inside it shouldn't be used.
2020-02-13improve comments:Ralf Jung-0/+1
- comment for special handling of Shl/Shr - reference a PR
2020-02-13small cleanup in ConstEvalErr::struct_genericRalf Jung-31/+40
2020-02-13move PanicInfo to mir moduleRalf Jung-60/+3
2020-02-13remove PanicInfo::Panic variant that MIR does not use or needRalf Jung-7/+2
2020-02-13remove Panic variant from InterpErrorRalf Jung-21/+15
2020-02-12Fix outdated doc comment.jumbatm-4/+3
2020-02-11Run RustFmtjumbatm-9/+8
2020-02-11Invert control in struct_lint_level.jumbatm-31/+50
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-01-24Render const pointers in MIR more compactlyOliver Scherer-3/+9
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-16let rustfmt undo most of my edits :(Ralf Jung-2/+1
2020-01-16fix rustfmt falloutRalf Jung-4/+5
2020-01-14Code review changes and fix rustdoc test.Ben Lewis-5/+5
2020-01-14perf: eagerly convert literals to consts, this avoids creating loads on ↵Ben Lewis-1/+20
unevaluated consts which requires a lot of unnecessary work to evaluate them further down the line.
2020-01-12Rollup merge of #68045 - Centril:liberate-lints, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Move more of `rustc::lint` into `rustc_lint` Based on https://github.com/rust-lang/rust/pull/67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-2/+7
Promote references to constants instead of statics r? @oli-obk
2020-01-11lints: promote levels.rs to lint.rs & extract passes.rsMazdak Farrokhzad-1/+1
2020-01-10Promoteds also need param envs.Oliver Scherer-2/+2
This also allows us to use the `const_eval` query again without causing cycles
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-1/+6
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-1/+1
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-3/+3
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-2/+2
2019-12-30Auto merge of #67658 - spastorino:do-not-copy-zsts, r=oli-obkbors-0/+8
Avoid memory copy logic for zsts r? @oli-obk One of the included commits is work done by @HeroicKatora in #62655
2019-12-30Auto merge of #67631 - oli-obk:polymorphic_promotion, r=wesleywiserbors-1/+1
Work around a resolve bug in const prop r? @wesleywiser @anp This isn't exposed right now, but further changes to rustc may start causing bugs without this.
2019-12-28Avoid copying some undef memory in MIRSantiago Pastorino-0/+8
During MIR interpretation it may happen that a place containing uninitialized bytes is copied. This would read the current representation of these bytes and write it to the destination even though they must, by definition, not matter to the execution. This elides that representation change when no bytes are defined in such a copy, saving some cpu cycles. In such a case, the memory of the target allocation is not touched at all which also means that sometimes no physical page backing the memory allocation of the representation needs to be provided by the OS at all, reducing memory pressure on the system.
2019-12-28Rollup merge of #67604 - christianpoveda:scalar_to_(u|i)64, r=RalfJungOliver Scherer-21/+35
Add Scalar::to_(u|i)16 methods r? @RalfJung
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-1/+1
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-26Early abort instead of building up zero sized valuesOliver Scherer-4/+0
2019-12-26Prevent an ICE on invalid transmutesOliver Scherer-0/+6
2019-12-26Retire `to_ptr` which should already have no users but still kept getting ↵Oliver Scherer-7/+2
new ones
2019-12-26Don't ICE on the use of integer addresses for ZST constants in pattern matchingOliver Scherer-0/+4
2019-12-25rewrite scalar to integer methodsChristian Poveda-28/+29
2019-12-25Add Scalar::to_(u|i)16 methodsChristian Poveda-0/+13
2019-12-22Format the worldMark Rousskov-462/+407