about summary refs log tree commit diff
path: root/src/librustc_const_eval/eval.rs
AgeCommit message (Collapse)AuthorLines
2016-09-20rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.Eduard Burtescu-7/+5
2016-09-20rustc_metadata: move more RBML tags to auto-serialization.Eduard Burtescu-3/+11
2016-09-20rustc: replace uses of NodeId in Def, other than closures and labels.Eduard Burtescu-1/+2
2016-09-20Don't ICE when a float can't be parsedmcarton-8/+8
2016-09-11Use question_mark feature in librustc_const_eval.Ahmed Charles-22/+19
2016-09-08Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`Vadim Petrochenkov-8/+7
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-3/+3
2016-09-04Replace `_, _, _` with `..`Vadim Petrochenkov-1/+1
2016-09-03Translate union constantsVadim Petrochenkov-2/+5
Fix alignment for packed unions Add some missing privacy test Get rid of `unimplemented_unions` macro
2016-09-03Some better support for unions through the compilerVadim Petrochenkov-1/+2
2016-08-17rustc: reduce Substs and Generics to a simple immutable API.Eduard Burtescu-8/+8
2016-08-12rustc: rename ProjectionMode and its variant to be more memorable.Eduard Burtescu-4/+4
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-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-07Turn on new errors, json mode. Remove duplicate unicode testJonathan Turner-6/+2
2016-08-05Updated E0306 to new format.Federico Ravasio-4/+7
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-27Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakisbors-67/+165
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-67/+191
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-08Merge PatKind::QPath into PatKind::Path in HIRVadim Petrochenkov-1/+1
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-23Move errors from libsyntax to its own crateJonathan Turner-2/+2
2016-06-21don't warn on casting byte strs to slicesOliver Schneider-0/+1
2016-06-10Auto merge of #34174 - shepmaster:16-bit-mir, r=Aatchbors-20/+5
Support 16-bit pointers in MIR
2016-06-10Allow truncating constants to 16-bit u/isizeJake Goulding-20/+5
2016-06-10Introduce TyCtxt::expect_def/expect_resolution helpers and use them where ↵Vadim Petrochenkov-25/+14
possible
2016-06-05rustc_const_eval: work around double rounding.Eduard Burtescu-38/+71
2016-06-05rustc_const_eval: track the length and index in IndexOutOfBounds.Eduard Burtescu-5/+14
2016-06-05rustc_const_eval: strings are not indexable in Rust 1.x.Eduard Burtescu-3/+0
2016-06-05rustc_const_eval: remove unused arithmetic ErrKind variants.Eduard Burtescu-12/+0
2016-06-03Auto merge of #33460 - shepmaster:16-bit-pointers, r=Aatchbors-0/+3
Support 16-bit pointers as well as i/usize I'm opening this pull request to get some feedback from the community. Although Rust doesn't support any platforms with a native 16-bit pointer at the moment, the [AVR-Rust][ar] fork is working towards that goal. Keeping this forked logic up-to-date with the changes in master has been onerous so I'd like to merge these changes so that they get carried along when refactoring happens. I do not believe this should increase the maintenance burden. This is based on the original work of Dylan McKay (@dylanmckay). [ar]: https://github.com/avr-rust/rust
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-5/+4
2016-05-19Support 16-bit pointers as well as i/usizeJake Goulding-0/+3
This is based on the original work of Dylan McKay for the [avr-rust project][ar]. [ar]: https://github.com/avr-rust/rust
2016-05-11rustc: Split local type contexts interners from the global one.Eduard Burtescu-2/+1
2016-05-11rustc: More interning for data used in Ty<'tcx>.Eduard Burtescu-3/+3
2016-05-11rustc: Wrap users of InferCtxt in an anonymous scope.Eduard Burtescu-38/+37
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-17/+23
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-32/+31
2016-05-11rustc: Avoid free functions taking &TyCtxt and &InferCtxt.Eduard Burtescu-7/+6
2016-05-11infer: Use methods for creating an InferCtxt.Eduard Burtescu-2/+3
2016-05-09Auto merge of #33457 - oli-obk:const_err/cast_u8_ptr, r=eddybbors-0/+6
casting `&[u8]` to `* const u8` doesn't work in const_eval fixes #33452 r? @eddyb cc @Ms2ger
2016-05-08Auto merge of #33091 - sanxiyn:unused-trait-import-3, r=nrcbors-1/+1
Warn unused trait imports, rebased Rebase of #30021. Fix #25730.
2016-05-08casting `b"text"` to `* const u8` doesn't work in const_evalOliver 'ker' Schneider-0/+6
2016-05-03Rollup merge of #33339 - oli-obk:fix/const_eval, r=japaricManish Goregaokar-48/+37
fix various const eval errors These were found after const_evaluating arbitrary expressions and linting if the const evaluator failed fixes #33275 (int -> float casts for negative ints) fixes #33291 (int -> char casts (new! wasn't allowed in constants until this PR)) r? @eddyb cc @bluss @japaric
2016-05-03Remove unused trait imports flagged by lintSeo Sanghyeon-1/+1
2016-05-02refactor infer functionOliver Schneider-20/+20
There was no span available in the cast function, but we need to infer the `x` in `x as char` to `u8`. The spans are now removed from all functions using `infer` and instead added in `eval_const_expr_partial`