summary refs log tree commit diff
path: root/src/librustc_const_eval
AgeCommit message (Collapse)AuthorLines
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-57/+35
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-3/+5
2017-06-01move projection mode into parameter environmentNiko Matsakis-3/+2
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-57/+35
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-4/+2
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-4/+2
2017-05-30Turn sufficiently old compatibility lints into hard errorsVadim Petrochenkov-15/+6
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-13Auto merge of #41847 - alexcrichton:less-unstable-annotations, r=eddybbors-3/+4
rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-11rustc: Remove #![unstable] annotationAlex Crichton-3/+4
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-05-09resolved merge conflictsachernyak-13/+13
2017-05-08Remove need for &format!(...) or &&"" dances in `span_label` callsOliver Schneider-13/+13
2017-05-04trait_of_itemachernyak-1/+1
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-3/+3
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-27query for describe_defachernyak-1/+1
2017-04-24rustc: use tcx.at(span) to set the location of a query.Eduard-Mihai Burtescu-1/+1
2017-04-24rustc: expose the common DUMMY_SP query case as tcx methods.Eduard-Mihai Burtescu-2/+2
2017-04-24rustc: rename some of the queries to match tcx methods.Eduard-Mihai Burtescu-5/+5
2017-04-23rustc_const_eval: support all unit enum variants.Eduard-Mihai Burtescu-45/+40
2017-04-23rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases.Eduard-Mihai Burtescu-1/+1
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-107/+89
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: use monomorphic const_eval for cross-crate enum discriminants.Eduard-Mihai Burtescu-4/+7
2017-04-16rustc: expose monomorphic const_eval through on-demand.Eduard-Mihai Burtescu-34/+15
2017-04-16rustc_const_eval: move ConstEvalErr to the rustc crate.Eduard-Mihai Burtescu-209/+24
2017-03-31Don't warn about `char` comparisons in constexprsMatthew Jasper-0/+11
2017-03-27Fix various useless derefs and slicingsOliver Schneider-3/+3
2017-03-23Remove internal liblogAlex Crichton-1/+1
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-13clean up visuals on error index #40425Joshua Horwitz-3/+3
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: demand that the MIR qualify_consts ran on each evaluated body.Eduard-Mihai Burtescu-1/+2
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-510/+251
2017-02-25rustc_typeck: rework coherence to be almost completely on-demand.Eduard-Mihai Burtescu-2/+2
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-4/+2
2017-02-25rustc: introduce a query system for type information in ty::maps.Eduard Burtescu-1/+1
2017-02-25rustc: consolidate dep-tracked hashmaps in tcx.maps.Eduard-Mihai Burtescu-5/+5
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-30/+82
Fixes #38972.
2017-02-10Use global recursion limit when evaluating inhabitednessAndrew Cann-3/+3
2017-02-09Add recursion limit to inhabitedness checkAndrew Cann-1/+1
Fixes #39489. Add test aswell.
2017-02-05Rollup merge of #39526 - canndrew:uninhabited-while-let-fix, r=arielb1Corey Farwell-5/+22
Uninhabited while-let pattern fix This fix makes it so while-let with an unsatisfiable pattern raises a correct warning rather than an incorrect error.
2017-02-05Rollup merge of #39519 - nagisa:more-snap, r=alexcrichtonCorey Farwell-6/+3
More snap cleanup r? @alexcrichton
2017-02-05Fix make tidyAndrew Cann-2/+3