summary refs log tree commit diff
path: root/src/librustc_const_eval
AgeCommit message (Collapse)AuthorLines
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
2017-02-05Rollup merge of #39009 - canndrew:default-unit-warnings, r=nikomatsakisCorey Farwell-3/+3
Add warning for () to ! switch With feature(never_type) enabled diverging type variables will default to `!` instead of `()`. This can cause breakages where a trait is resolved on such a type. This PR emits a future-compatibility warning when it sees this happen.
2017-02-05Remove use of ptr::eqAndrew Cann-14/+18
2017-02-04Uninhabited while-let pattern fixAndrew Cann-4/+16
2017-02-04More snap cleanupSimonas Kazlauskas-6/+3
2017-02-03Bump version, upgrade bootstrapAlex Crichton-5/+1
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-02-03Add warning for () to ! switchAndrew Cann-3/+3
2017-01-31use suggestions instead of helps with code in themOliver Schneider-2/+0
2017-01-30Merge ty::TyBox into ty::TyAdtVadim Petrochenkov-3/+1
2017-01-27Rollup merge of #39290 - canndrew:hide-uninhabitedness, r=nikomatsakisAlex Crichton-4/+13
Hide uninhabitedness checks behind feature gate This reverts the fix to match exhaustiveness checking so that it can be discussed. The new code is now hidden behind the `never_type` feature gate.
2017-01-26rustc: don't call the HIR AST.Eduard-Mihai Burtescu-5/+5
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-23/+23
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-11/+11
2017-01-25Hide uninhabitedness checks behind feature gateAndrew Cann-4/+13
2017-01-25Auto merge of #35712 - oli-obk:exclusive_range_patterns, r=nikomatsakisbors-24/+47
exclusive range patterns adds `..` patterns to the language under a feature gate (`exclusive_range_pattern`). This allows turning ``` rust match i { 0...9 => {}, 10...19 => {}, 20...29 => {}, _ => {} } ``` into ``` rust match i { 0..10 => {}, 10..20 => {}, 20..30 => {}, _ => {} } ```
2017-01-22Auto merge of #39127 - canndrew:unreachable-pattern-errors-into-warnings, ↵bors-11/+4
r=arielb1 Change unreachable pattern ICEs to warnings Allow code with unreachable `?` and `for` patterns to compile. Add some tests.
2017-01-22Remove unused `extern crate`s.Jeffrey Seyfried-2/+0
2017-01-21Fix some nitsAndrew Cann-0/+2
2017-01-19add exclusive range patterns under a feature gateOliver Schneider-24/+47
2017-01-17Change unreachable patterns ICEs to warningsAndrew Cann-11/+2
Allow code with unreachable `?` and `for` patterns to compile. Add some tests.
2017-01-11Fix two const-eval issues related to i128 negationSimonas Kazlauskas-13/+16
First issue here was the fact that we’d only allow negating integers in i64 range in case the integer was not infered yes. While this is not the direct cause of the issue, its still good to fix it. The real issue here is the code handling specifically the `min_value` literals. While I128_OVERFLOW has the expected value (0x8000_..._0000), match using this value as a pattern is handled incorrectly by the stage1 compiler (it seems to be handled correctly, by the stage2 compiler). So what we do here is extract this pattern into an explicit `==` until the next snapshot. Fixes #38987
2017-01-06rustc: store ty::Tables separately for each body (except closures').Eduard-Mihai Burtescu-30/+44
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-213/+218
2017-01-06fix doc test for E0001Andrew Cann-1/+1
2017-01-05Un-remove E0001, put a notice on it insteadAndrew Cann-0/+27
2017-01-04Fix build after rebaseAndrew Cann-23/+31
2017-01-03Spelling. s/forrest/forestAndrew Cann-4/+4
2017-01-03fix comment that got split in twoNiko Matsakis-3/+2
2017-01-03Fix build after rebase.Andrew Cann-16/+18
Mostly just rename stuff. Visibility checks use DefIds rather than NodeIds now.
2017-01-03Remove E0001 diagnosticAndrew Cann-25/+0
2017-01-03Disable unreachable patterns error entirelyAndrew Cann-12/+9
2017-01-03Refactor is_uninhabitedAndrew Cann-7/+7
We now cache the inhabitedness of types in the GlobalCtxt. Rather than calculating whether a type is visibly uninhabited from a given NodeId we calculate the full set of NodeIds from which a type is visibly uninhabited then cache that set. We can then use that to answer queries about the inhabitedness of a type relative to any given node.
2017-01-03Fix build after rebaseAndrew Cann-5/+5
2017-01-03Style fixAndrew Cann-2/+1
2017-01-03Improve error message, fix and add tests.Andrew Cann-28/+41
Changes the non-exhaustive match error message to generate more general witnesses.
2017-01-03More pattern matching for empty types changesAndrew Cann-84/+128
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.
2017-01-03Make is_useful handle empty types properlyAndrew Cann-19/+66