summary refs log tree commit diff
path: root/src/librustc_const_eval
AgeCommit message (Collapse)AuthorLines
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-2/+2
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-14Rollup merge of #35644 - garekkream:update-E0302-new-error-format, ↵Eduard-Mihai Burtescu-1/+3
r=jonathandturner Update E0302 to the new format Part of #35233. Fixes #35523. r? @jonathandturner
2016-08-13Minor fixups based on feedbackAndrew Cann-1/+1
2016-08-13Rename empty/bang to neverAndrew Cann-3/+3
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Update E0302 to the new formatKrzysztof Garczynski-1/+3
2016-08-13Update E0301 to the new formatKrzysztof Garczynski-1/+3
2016-08-12rustc: rename ProjectionMode and its variant to be more memorable.Eduard Burtescu-7/+7
2016-08-11Rollup merge of #35532 - KiChjang:e0004-follow-up, r=jonathandturnerJonathan Turner-6/+1
Do not span across nodes for E0004 Part of #35233. Fixes #35529. r? @arielb1
2016-08-11Rollup merge of #35530 - srdja:master, r=jonathandturnerJonathan Turner-2/+8
Update E0008 and E0007 to new format Part of #35233 A fix for #35496 r? @jonathandturner
2016-08-10Auto merge of #35525 - jonathandturner:rollup, r=jonathandturnerbors-1/+4
Rollup of 15 pull requests - Successful merges: #35371, #35396, #35446, #35449, #35452, #35458, #35465, #35466, #35470, #35475, #35477, #35484, #35504, #35507, #35524 - Failed merges: #35395, #35415
2016-08-09Auto merge of #35401 - jonathandturner:enable_json_and_new_errors, ↵bors-6/+2
r=jonathandturner Turn on new errors and json mode This PR is a big-switch, but on a well-worn path: * Turns on new errors by default (and removes old skool) * Moves json output from behind a flag The RFC for new errors [landed](https://github.com/rust-lang/rfcs/pull/1644) and as part of that we wanted some bake time. It's now had a few weeks + all the time leading up to the RFC of people banging on it. We've also had [editors updating to the new format](https://github.com/saviorisdead/RustyCode/pull/159) and expect more to follow. We also have an [issue on old skool](https://github.com/rust-lang/rust/issues/35330) that needs to be fixed as more errors are switched to the new style, but it seems silly to fix old skool errors when we fully intend to throw the switch in the near future. This makes it lean towards "why not just throw the switch now, rather than waiting a couple more weeks?" I only know of vim that wanted to try to parse the new format but were not sure how, and I think we can reach out to them and work out something in the 8 weeks before this would appear in a stable release. We've [hashed out](https://github.com/rust-lang/rust/issues/35330) stabilizing JSON output, and it seems like people are relatively happy making what we have v1 and then likely adding to it in the future. The idea is that we'd maintain backward compatibility and just add new fields as needed. We'll also work on a separate output format that'd be better suited for interactive tools like IDES (since JSON message can get a little long depending on the error). This PR stabilizes JSON mode, allowing its use without `-Z unstable-options` Combined, this gives editors two ways to support errors going forward: parsing the new error format or using the JSON mode. By moving JSON to stable, we can also add support to Cargo, which plugin authors tell us does help simplify their support story. r? @nikomatsakis cc @rust-lang/tools Closes https://github.com/rust-lang/rust/issues/34826
2016-08-09Update E0007 to new formatsrdja-1/+4
2016-08-09Auto merge of #35166 - nikomatsakis:incr-comp-ice-34991-2, r=mwbors-2/+2
Address ICEs running w/ incremental compilation and building glium Fixes for various ICEs I encountered trying to build glium with incremental compilation enabled. Building glium now works. Of the 4 ICEs, I have test cases for 3 of them -- I didn't isolate a test for the last commit and kind of want to go do other things -- most notably, figuring out why incremental isn't saving much *effort*. But if it seems worthwhile and I can come back and try to narrow down the problem. r? @michaelwoerister Fixes #34991 Fixes #32015
2016-08-08Do not span across nodes for E0004Keith Yeung-6/+1
2016-08-08Update E0008 to new formatsrdja-1/+4
2016-08-08Update E0162 to the new formatKrzysztof Garczynski-1/+4
2016-08-07Lengthen the span label to include match and expr for E0004Keith Yeung-1/+6
2016-08-07Turn on new errors, json mode. Remove duplicate unicode testJonathan Turner-6/+2
2016-08-06Auto merge of #35393 - GuillaumeGomez:err_codes2, r=jonathandturnerbors-22/+26
Err codes r? @jonathandturner
2016-08-06Rollup merge of #35380 - TheZoq2:master, r=jonathandturnerEduard-Mihai Burtescu-2/+7
Update E0004 to use labels Fixes #35191 and is part of #35233 "r? @jonathandturner
2016-08-06Rollup merge of #35370 - razielgn:updated-e0306-to-new-format, r=jonathandturnerEduard-Mihai Burtescu-4/+7
Updated E0306 to new format. Part of #35233. Fixes #35315. r? @jonathandturner
2016-08-05Add error code check in librustc_const_eval/diagnostics.rsGuillaume Gomez-22/+26
2016-08-05Update E0004 to use labelsTheZoq2-2/+7
2016-08-05Updated E0306 to new format.Federico Ravasio-4/+7
2016-08-04Changing label to "this is an..."saml-1/+1
2016-08-04Set label for unreachable patternsaml-0/+1
Part of #35233 Fixes #35190 r? @jonathandturner
2016-08-02replace graph rewriting with detecting inlined idsNiko Matsakis-2/+2
We now detect inlined id's earlier (in the HIR map) and rewrite a read of them to be a read of the metadata for the associated item.
2016-08-01Move caching of HIR-inlining into CStore in order to avoid duplicating ↵Michael Woerister-6/+6
inlined HIR.
2016-07-29intravisit: Fold functionality of IdVisitor into the regular Visitor.Michael Woerister-6/+4
2016-07-27Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakisbors-119/+212
Centralize and clean type error reporting Refactors the code that handles type errors to be cleaner and fixes various edge cases. This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged. Fixes #31173 r? @jonathandturner, cc @nikomatsakis
2016-07-23address review commentsAriel Ben-Yehuda-27/+1
I split the RFC1592 commit out
2016-07-22refactor constant evaluation error reportingAriel Ben-Yehuda-119/+238
Refactor constant evaluation to use a single error reporting function that reports a type-error-like message. Also, unify all error codes with the "constant evaluation error" message to just E0080, and similarly for a few other duplicate codes. The old situation was a total mess, and now that we have *something* we can further iterate on the UX.
2016-07-22improve const eval error reporting on "" and b"" castsOliver Schneider-2/+16
2016-07-11Auto merge of #34686 - alexcrichton:new-stage, r=luqmanabors-2/+1
rustc: Update stage0 to beta-2016-07-06 Hot off the presses, let's update our stage0 compiler!
2016-07-08Merge PatKind::QPath into PatKind::Path in HIRVadim Petrochenkov-5/+5
2016-07-08Remove unnecessary accessor function VariantDefData::kindVadim Petrochenkov-4/+4
2016-07-08Cleanup of some pattern related codeVadim Petrochenkov-14/+6
2016-07-06rustc: Update stage0 to beta-2016-07-06Alex Crichton-2/+1
Hot off the presses, let's update our stage0 compiler!
2016-07-04Auto merge of #34638 - zackmdavis:if_let_over_none_empty_block_arm, r=jseyfriedbors-3/+2
prefer `if let` to match with `None => {}` arm in some places This is a spiritual succesor to #34268 / 8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block. ---- r? @jseyfried
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-3/+2
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-07-03std: Stabilize APIs for the 1.11.0 releaseAlex Crichton-1/+0
Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-06-29Rollup merge of #34497 - oli-obk:double_negation, r=eddybManish Goregaokar-48/+41
Revert "skip double negation in const eval" This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8. fixes #34395 The original commit was based on a mis-understanding of the overflowing literal lint. This needs to be ported to beta. r? @eddyb
2016-06-27Revert "skip double negation in const eval"Oliver Schneider-48/+41
This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-1/+1
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-4/+6
2016-06-21don't warn on casting byte strs to slicesOliver Schneider-0/+1
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-1/+1
2016-06-16Rollup merge of #34207 - petrochenkov:nohyg, r=jseyfriedManish Goregaokar-2/+1
Remove last traces of identifier hygiene from HIR https://github.com/rust-lang/rust/pull/34095/commits/e783a0a5e39d5ae2fa147508197d09a51530fae8 removed the [last](https://github.com/rust-lang/rust/pull/33654#discussion_r63415218) [use](https://github.com/rust-lang/rust/pull/33654#discussion_r63416284) of hygiene at post-resolve compilation stages, so we can avoid renaming during lowering to HIR and just keep original names. r? @nrc
2016-06-10Auto merge of #34174 - shepmaster:16-bit-mir, r=Aatchbors-20/+5
Support 16-bit pointers in MIR
2016-06-11Remove last traces of identifier hygiene from HIRVadim Petrochenkov-2/+1