about summary refs log tree commit diff
path: root/src/librustc/middle/check_const.rs
AgeCommit message (Collapse)AuthorLines
2016-01-21move more checks out of librustcOliver Schneider-949/+0
2016-01-20Rename Def's variants and don't reexport themVadim Petrochenkov-12/+12
2016-01-20Refactor definitions of ADTs in rustc::middle::defVadim Petrochenkov-3/+3
2016-01-16Auto merge of #30533 - nikomatsakis:fulfillment-tree, r=aturonbors-2/+2
This PR introduces an `ObligationForest` data structure that the fulfillment context can use to track what's going on, instead of the current flat vector. This enables a number of improvements: 1. transactional support, at least for pushing new obligations 2. remove the "errors will be reported" hack -- instead, we only add types to the global cache once their entire subtree has been proven safe. Before, we never knew when this point was reached because we didn't track the subtree. - this in turn allows us to limit coinductive reasoning to structural traits, which sidesteps #29859 3. keeping the backtrace should allow for an improved error message, where we give the user full context - we can also remove chained obligation causes This PR is not 100% complete. In particular: - [x] Currently, types that embed themselves like `struct Foo { f: Foo }` give an overflow when evaluating whether `Foo: Sized`. This is not a very user-friendly error message, and this is a common beginner error. I plan to special-case this scenario, I think. - [x] I should do some perf. measurements. (Update: 2% regression.) - [x] More tests targeting #29859 - [ ] The transactional support is not fully integrated, though that should be easy enough. - [ ] The error messages are not taking advantage of the backtrace. I'd certainly like to do 1 through 3 before landing, but 4 and 5 could come as separate PRs. r? @aturon // good way to learn more about this part of the trait system f? @arielb1 // already knows this part of the trait system :)
2016-01-16fallout from removing the `errors_will_be_reported` flagNiko Matsakis-2/+2
2016-01-16Auto merge of #30930 - oli-obk:fix/30887, r=arielb1bors-26/+7
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet). fixes #30887 r? @pnkfelix
2016-01-15move const block checks before lowering stepOliver Schneider-26/+7
this makes sure the checks run before typeck (which might use the constant or const function to calculate an array length) and gives prettier error messages in case of for loops and such (since they aren't expanded yet).
2016-01-14Support generic associated constsMichael Wu-5/+2
2016-01-05Annotate the compiler with information about what it is doing when.Niko Matsakis-2/+2
2015-12-30use structured errorsNick Cameron-20/+21
2015-12-16Implement type ascription.Eduard Burtescu-0/+1
2015-12-05fix const index feature-gate regressionOliver Schneider-1/+3
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-14/+15
straightforward uses of `visit_all_items`. In some cases I had to remove empty `visit_item` calls that were just to suppress visiting nested items.
2015-11-16ImplItem_ -> ImplItemKind renameOliver Schneider-1/+1
2015-11-16rename ImplItem_::*ImplItem to ImplItem_::*Oliver Schneider-1/+1
[breaking change]
2015-11-05remove excess string allocationSteve Klabnik-1/+1
&format!("...") is the same as "" if we're not doing any interpolation, and doesn't allocate an intermediate String.
2015-11-02Auto merge of #28846 - Ms2ger:categorization, r=nikomatsakisbors-14/+15
2015-10-31Remove PatWildMultiVadim Petrochenkov-1/+1
2015-10-29Rename categorization and stop re-exporting its variants.Ms2ger-14/+15
2015-10-19allow constant evaluation of function callsOliver Schneider-1/+1
2015-10-13implement RFC 1229Oliver Schneider-4/+4
const eval errors outside of true constant enviroments are not reported anymore, but instead forwarded to a lint.
2015-10-10Whitelisting PatWild for E0022. Fix #28822glendc-0/+1
2015-10-01Introduce semi-duplicate DefIds into DefLocal/DefUpvar to remove useNiko Matsakis-1/+1
of xxx_local.
2015-09-26Remove warning of duplicated error codeGuillaume Gomez-7/+13
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-2/+1
2015-09-20Don't recommend const fns on a stable build without a note about nightliesManish Goregaokar-4/+16
Fixes #28490
2015-09-17Remove hir::ExprParenNick Cameron-2/+0
2015-09-16Auto merge of #28353 - GuillaumeGomez:error_codes, r=Manishearthbors-9/+9
r? @Manishearth This is a work in progress.
2015-09-16End of adding error codes in librustcGuillaume Gomez-9/+9
2015-09-14split ty::util and ty::adjustmentAriel Ben-Yehuda-2/+7
2015-09-14move middle::ty and related modules to middle/ty/Ariel Ben-Yehuda-1/+1
2015-09-10Fix ICE per #28172christopherdumas-2/+2
2015-09-03Add an intital HIR and lowering stepNick Cameron-95/+88
2015-08-31Auto merge of #28007 - Ms2ger:FnKind, r=nrcbors-5/+5
There is no longer a need for that pattern, since enums are now qualified.
2015-08-26Rename FnKind variants and stop re-exporting them from the visit module.Ms2ger-5/+5
There is no longer a need for that pattern, since enums are now qualified.
2015-08-25move destructors_for_type into AdtDefAriel Ben-Yehuda-1/+1
2015-08-24fallout from moving def-idNiko Matsakis-1/+2
2015-08-06introduce an ADTDef struct for struct/enum definitionsAriel Ben-Yehuda-2/+2
2015-08-04rustc: replace def::MethodProvenance with ty::ImplOrTraitItemContainer.Eduard Burtescu-2/+9
2015-07-17Clarify the usage of "hints" in const_eval.Eli Friedman-1/+17
The "hint" mechanism is essentially used as a workaround to compute types for expressions which have not yet been type-checked. This commit clarifies that usage, and limits the effects to the places where it is currently necessary. Fixes #26210.
2015-07-07mark user-defined derefs as non-constantAriel Ben-Yehuda-0/+20
Fixes #25901
2015-07-04rustc: remove MethodOrigin and use the container to distinguish inherent ↵Eduard Burtescu-5/+4
methods.
2015-07-04rustc: simplify ty::MethodOrigin and avoid trait item indices.Eduard Burtescu-7/+5
2015-06-30Remove Typer and ClosureTyperJared Roesch-1/+1
This commit finalizes the work of the past commits by fully moving the fulfillment context into the InferCtxt, cleaning up related context interfaces, removing the Typer and ClosureTyper traits and cleaning up related intefaces
2015-06-30Remove Typer + ClosureTyper impls for BlockSJared Roesch-2/+1
2015-06-30Remove Typer + ClosureTyper impls for ParameterEnvJared Roesch-3/+6
2015-06-30Use fresh FulfillmentContexts in select locationsJared Roesch-1/+1
2015-06-30Update all uses of FulfillmentContextJared Roesch-1/+1
Update all uses of FulfillmentContext to be ones obtained via an InferCtxt. This is another step of flattening the type checking context into a single piece of state.
2015-06-27Ground work for replacing the ClosureTyper traitJared Roesch-1/+1
2015-06-27Begin refactor type checking stateJared Roesch-5/+4
This first patch starts by moving around pieces of state related to type checking. The goal is to slowly unify the type checking state into a single typing context. This initial patch moves the ParameterEnvironment into the InferCtxt and moves shared tables from Inherited and ty::ctxt into their own struct Tables. This is the foundational work to refactoring the type checker to enable future evolution of the language and tooling.