about summary refs log tree commit diff
path: root/src/librustc/mir
AgeCommit message (Collapse)AuthorLines
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-14Prepare to use borrowck to resolve opaque typesMatthew Jasper-1/+7
2020-02-13Add `Place` getter to `Operand`Dylan MacKenzie-0/+9
2020-02-13rename PanicInfo -> AssertKindRalf Jung-10/+10
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-63/+59
2020-02-13remove PanicInfo::Panic variant that MIR does not use or needRalf Jung-12/+5
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-02-02Add resume arg place to `Yield` MIR terminatorJonas Schievink-3/+14
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-1/+1
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-29Auto merge of #68512 - spastorino:local-is-copy, r=oli-obkbors-11/+11
Local is copy r? @oli-obk
2020-01-28Fix a few spelling mistakesgorilskij-2/+2
2020-01-28Remove unneeded & on match patternSantiago Pastorino-2/+2
2020-01-28Place::ty_from takes local by valueSantiago Pastorino-3/+3
2020-01-28Local field on PlaceRef and RootPlace is not a reference anymoreSantiago Pastorino-7/+7
2020-01-27make matches exhaustiveMatthias Krüger-6/+14
2020-01-27don't clone types that are copy, round two.Matthias Krüger-6/+6
2020-01-25Auto merge of #68516 - oli-obk:spaces, r=eddybbors-3/+9
Render const pointers in MIR more compactly Split out from #67133 to make that PR simpler cc @RalfJung r? @eddyb
2020-01-24Render const pointers in MIR more compactlyOliver Scherer-3/+9
2020-01-23Clarify some methods around instance instantiation via comments and clearer ↵Michael Woerister-3/+3
names.
2020-01-21Auto merge of #65672 - ecstatic-morse:unified-dataflow-proto, r=pnkfelixbors-0/+25
A single framework for gen-kill and generic dataflow problems This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface. r? @ghost cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)
2020-01-21Rollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obkYuki Okushi-4/+1
Filter and test predicates using `normalize_and_test_predicates` for const-prop Fixes #68264 Previously, I attempted to use `substitute_normalize_and_test_predicates` to detect unsatisfiable bounds. Unfortunately, since const-prop runs in a generic environment (we don't have any of the function's generic parameters substituted), this could lead to cycle errors when attempting to normalize predicates. This check is replaced with a more precise check. We now only call `normalize_and_test_predicates` on predicates that have the possibility of being proved unsatisfiable - that is, predicates that don't depend on anything local to the function (e.g. generic parameters). This ensures that we don't hit cycle errors when we normalize said predicates, while still ensuring that we detect unsatisfiable predicates. I haven't been able to come up with a minimization of the Diesel issue - however, I've verified that it compiles successfully.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-17Rollup merge of #68288 - RalfJung:fmt, r=oli-obkDylan DPC-3/+3
Fix some of the rustfmt fallout in Miri re-post of https://github.com/rust-lang/rust/pull/67833 without the `rustfmt::skip` r? @oli-obk
2020-01-16Revert previous attempt at detecting unsatisfiable predicatesAaron Hill-4/+1
2020-01-16let rustfmt undo most of my edits :(Ralf Jung-2/+1
2020-01-16fix rustfmt falloutRalf Jung-4/+5
2020-01-15Rollup merge of #67914 - Aaron1011:fix/const-prop-impossible, ↵Yuki Okushi-1/+4
r=matthewjasper,oli-obk Don't run const propagation on items with inconsistent bounds Fixes #67696 Using `#![feature(trivial_bounds)]`, it's possible to write functions with unsatisfiable 'where' clauses, making them uncallable. However, the user can act as if these 'where' clauses are true inside the body of the function, leading to code that would normally be impossible to write. Since const propgation can run even without any user-written calls to a function, we need to explcitly check for these uncallable functions.
2020-01-14Add test for `ResultsCursor`Dylan MacKenzie-0/+25
This is a unit test that ensures the `seek` functions work correctly.
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-13Use TraitQueryMode::Canonical when testing predicates in const propAaron Hill-1/+4
2020-01-12Auto merge of #67901 - matthewjasper:split-mir-build, r=nagisabors-221/+227
Split MIR building into its own crate This moves `rustc_mir::{build, hair, lints}` to `rustc_mir_build`. The new crate only has a `provide` function as it's public API. Based on #67898 cc @Centril @rust-lang/compiler r? @oli-obk
2020-01-12Split `rustc_mir::{build, hair, lints}` into their own crateMatthew Jasper-221/+227
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-182/+51
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-10Make Place CopySantiago Pastorino-1/+1
2020-01-10No need to use local.into hereSantiago Pastorino-1/+1
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-83/+32
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-60/+14
2020-01-10Remove StaticKindSantiago Pastorino-40/+5
2020-01-10Remove StaticKind::PromotedSantiago Pastorino-20/+5
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-1/+17
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1