about summary refs log tree commit diff
path: root/src/librustc_const_eval/pattern.rs
AgeCommit message (Collapse)AuthorLines
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-1069/+0
2018-03-08Produce instead of pointersOliver Schneider-122/+213
2018-03-08Add a variant to ConstVal for storing miri resultsOliver Schneider-0/+1
2018-02-08Encode (in MIR) whether borrows are explicit in source or arise due to autoref.Felix S. Klock II-2/+2
This is foundation for issue 46747 (limit two-phase borrows to method-call autorefs).
2018-01-31Rollup merge of #47876 - GuillaumeGomez:associated-const-error, r=nikomatsakiskennytm-1/+10
Update associated constants error message Fixes #47570.
2018-01-30Update associated constants error messageGuillaume Gomez-1/+10
2018-01-25Auto merge of #47374 - topecongiro:issue-47096, r=nikomatsakisbors-1/+3
Simplify irrefutable slice patterns Closes #47096.
2018-01-17Simplify irrefutable slice patternsSeiichi Uchida-1/+3
Closes #47096.
2018-01-13Use delay_span_bug() over debug!()Seiichi Uchida-1/+2
2018-01-12Ignore CTFE errors while lowering patternsSeiichi Uchida-1/+1
Closes #43105.
2017-11-18rustc_mir: always downcast enums, even if univariant.Eduard-Mihai Burtescu-2/+2
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-0/+38
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-09-18incr.comp.: Already hash HIR bodies during metadata export so they don't ↵Michael Woerister-1/+1
have to be hashed in downstream crates.
2017-09-11rustc: evaluate fixed-length array length expressions lazily.Eduard-Mihai Burtescu-1/+2
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-1/+2
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-1/+1
2017-09-11rustc: introduce ty::Const { ConstVal, Ty }.Eduard-Mihai Burtescu-8/+8
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-31/+28
2017-09-08Use NodeId/HirId instead of DefId for local variables.Eduard-Mihai Burtescu-2/+1
2017-09-05rustc: Rename item_body query to extern_const_bodyAlex Crichton-1/+1
Should hopefully more accurately reflect what's happening! This commit also removes the cache in the cstore implementation as it's already cached through the query infrastructure.
2017-09-05rustc: Migrate `CrateStore::item_body` to a queryAlex Crichton-1/+1
This commit migrates the `item_body` method on `CrateStore` to a query instead to enable better tracking of dependencies and whatnot.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-9/+9
Like #43008 (f668999), but _much more aggressive_.
2017-08-11Encapsulate sub-table access in TypeckTables and validate keys on each access.Michael Woerister-2/+2
2017-08-11Use ItemLocalId as key for TypeckTables::pat_binding_modes.Michael Woerister-1/+1
2017-08-11Use ItemLocalId as key for node_types, node_substs, and adjustments in ↵Michael Woerister-9/+9
TypeckTables.
2017-08-11Make TypeckTables::type_dependent_defs use ItemLocalId instead of NodeId.Michael Woerister-8/+8
2017-07-30default binding modes: add pat_binding_modesTobias Schottdorf-8/+12
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-7/+16
2017-07-27rustc_const_eval: always require correct Substs.Eduard-Mihai Burtescu-19/+25
2017-06-27rustc: move the PolyFnSig out of TyFnDef.Eduard-Mihai Burtescu-3/+3
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-2/+1
Decompose Adjustment into smaller steps and remove the method map. The method map held method callee information for: * actual method calls (`x.f(...)`) * overloaded unary, binary, indexing and call operators * *every overloaded deref adjustment* (many can exist for each expression) That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with: * a desire to compose adjustments more freely * containing the autoderef logic better to avoid mutation within an inference snapshot * not creating `TyFnDef` types which are incompatible with the original one * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs` * to fix #3548 by explicitly writing autorefs for the RHS of comparison operators Individual commits tell their own story, of "atomic" changes avoiding breaking semantics. Future work based on this PR could include: * removing the signature from `TyFnDef`, now that it's always "canonical" * some questions of variance remain, as subtyping *still* treats the signature differently * moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits` * allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments * transitive coercions (e.g. reify or unsize after multiple steps of autoderef) r? @nikomatsakis
2017-06-01rustc: remove unnecessary ItemSubsts wrapper.Eduard-Mihai Burtescu-2/+1
2017-05-30Turn sufficiently old compatibility lints into hard errorsVadim Petrochenkov-15/+6
2017-04-30intern CodeExtentsNiko Matsakis-2/+2
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-24rustc: rename some of the queries to match tcx methods.Eduard-Mihai Burtescu-2/+2
2017-04-23rustc_const_eval: support all unit enum variants.Eduard-Mihai Burtescu-1/+7
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-3/+8
2017-04-16rustc_const_eval: move ConstEvalErr to the rustc crate.Eduard-Mihai Burtescu-2/+2
2017-03-06Fix ICE: don't use `struct_variant` on enumsEsteban Küber-1/+5
Fix #40221 and add unittest.
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-12/+12
2017-02-03Add warning for () to ! switchAndrew Cann-1/+1
2017-01-30Merge ty::TyBox into ty::TyAdtVadim Petrochenkov-1/+1
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-1/+1
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-3/+3
2017-01-19add exclusive range patterns under a feature gateOliver Schneider-7/+13
2017-01-06rustc: store ty::Tables separately for each body (except closures').Eduard-Mihai Burtescu-1/+1
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-23/+30
2017-01-04Fix build after rebaseAndrew Cann-12/+15
2017-01-03Fix build after rebaseAndrew Cann-5/+5
2017-01-03More pattern matching for empty types changesAndrew Cann-5/+14
Fix is_uninhabited for enum types. It used to assume that an enums variant's fields were all private. Fix MIR generation for irrefutable Variant pattern matches. This allows code like this to work: let x: Result<32, !> = Ok(123); let Ok(y) = x; Carry type information on dummy wildcard patterns. Sometimes we need to expand these patterns into their constructors and we don't want to be expanding a TyError into a Constructor::Single.