about summary refs log tree commit diff
path: root/src/librustc_const_eval/check_match.rs
AgeCommit message (Collapse)AuthorLines
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-636/+0
2018-03-05Turn features() into a query.Michael Woerister-1/+1
2018-01-30Update associated constants error messageGuillaume Gomez-2/+9
2017-12-20Various tweaksEsteban Küber-2/+2
2017-12-19Use a label for catch-all pattern instead of noteEsteban Küber-1/+1
2017-12-04rustc_back: remove slice module in favor of std::slice::from_ref.Irina-Gabriela Popa-3/+3
2017-11-24Use visit_bodyShotaro Yamada-41/+5
2017-11-24QuerifyShotaro Yamada-19/+30
2017-11-24Visit const expressions in check matchShotaro Yamada-7/+46
2017-11-04Give better help for identifier patterns failing exhaustiveness checkVadim Petrochenkov-1/+8
2017-10-16convert constant promotion into a queryNiko Matsakis-1/+1
2017-10-16refactor inhabitedness to have clearer public entry pointsNiko Matsakis-1/+1
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-2/+2
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-4/+4
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-08-11Encapsulate sub-table access in TypeckTables and validate keys on each access.Michael Woerister-9/+6
2017-08-11Use ItemLocalId as key for TypeckTables::pat_binding_modes.Michael Woerister-3/+17
2017-08-11Use ItemLocalId as key for node_types, node_substs, and adjustments in ↵Michael Woerister-3/+3
TypeckTables.
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-13/+13
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-07-30default binding modes: add pat_binding_modesTobias Schottdorf-7/+19
This PR kicks off the implementation of the [default binding modes RFC][1] by introducing the `pat_binding_modes` typeck table mentioned in the [mentoring instructions][2]. `pat_binding_modes` is populated in `librustc_typeck/check/_match.rs` and used wherever the HIR would be scraped prior to this PR. Unfortunately, one blemish, namely a two callers to `contains_explicit_ref_binding`, remains. This will likely have to be removed when the second part of [1], the `pat_adjustments` table, is tackled. Appropriate comments have been added. See #42640. [1]: https://github.com/rust-lang/rfcs/pull/2005 [2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089
2017-07-27rustc_const_eval: keep track of the appropriate ParamEnv.Eduard-Mihai Burtescu-4/+6
2017-07-27rustc_const_eval: always require correct Substs.Eduard-Mihai Burtescu-4/+9
2017-06-10rustc: make InferCtxt optional in MemCategorizationContext.Eduard-Mihai Burtescu-10/+8
2017-06-10rustc: do not depend on infcx.tables in MemCategorizationContext.Eduard-Mihai Burtescu-2/+3
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-56/+32
Change for-loop desugar to not borrow the iterator during the loop This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-01strip param-env from infcxNiko Matsakis-2/+2
2017-06-01move projection mode into parameter environmentNiko Matsakis-2/+1
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-56/+32
2017-05-25Hygienize `librustc_typeck`.Jeffrey Seyfried-3/+3
2017-05-22rename `parameter_environment` to `param_env`Niko Matsakis-1/+1
2017-05-22rename `ParameterEnvironment` to `ParamEnv`Niko Matsakis-1/+1
2017-05-22centralize the caching for is-copy, is-sized, and is-freezeNiko Matsakis-3/+3
Use the trait-environment+type as the key. Note that these are only invoked on types that live for the entire compilation (no inference artifacts). We no longer need the various special-case bits and caches that were in place before.
2017-05-13rustc: stop interning CodeExtent, it's small enough.Eduard-Mihai Burtescu-1/+1
2017-05-13rustc: uniformly compute ParameterEnvironment's "free outlive scope".Eduard-Mihai Burtescu-4/+3
2017-05-08Remove need for &format!(...) or &&"" dances in `span_label` callsOliver Schneider-13/+13
2017-04-30modify `ExprUseVisitor` and friends to take region-maps, not def-idNiko Matsakis-5/+6
2017-04-30introduce per-fn RegionMapsTaylor Cramer-1/+6
Instead of requesting the region maps for the entire crate, request for a given item etc. Several bits of code were modified to take `&RegionMaps` as input (e.g., the `resolve_regions_and_report_errors()` function). I am not totally happy with this setup -- I *think* I'd rather have the region maps be part of typeck tables -- but at least the `RegionMaps` works in a "parallel" way to `FreeRegionMap`, so it's not too bad. Given that I expect a lot of this code to go away with NLL, I didn't want to invest *too* much energy tweaking it.
2017-04-30intern CodeExtentsNiko Matsakis-1/+1
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-18convert calls to `visit_all_item_likes_in_krate`Niko Matsakis-4/+1
We no longer need to track the tasks in these cases since these particular tasks have no outputs (except, potentially, errors...) and they always execute.
2017-04-16rustc_const_eval: move ConstEvalErr to the rustc crate.Eduard-Mihai Burtescu-16/+16
2017-03-27Fix various useless derefs and slicingsOliver Schneider-1/+1
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-1/+1
2017-02-25rustc_typeck: rework coherence to be almost completely on-demand.Eduard-Mihai Burtescu-1/+1
2017-02-23use a more conservative inhabitableness ruleAriel Ben-Yehuda-1/+15
This is a [breaking-change] from 1.15, because this used to compile: ```Rust enum Void {} fn foo(x: &Void) { match x {} } ```
2017-02-20check_match: don't treat privately uninhabited types as uninhabitedAriel Ben-Yehuda-0/+20
Fixes #38972.
2017-02-05Fix make tidyAndrew Cann-2/+3
2017-02-05Remove use of ptr::eqAndrew Cann-13/+18
2017-02-04Uninhabited while-let pattern fixAndrew Cann-4/+15
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-4/+4
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-1/+1