about summary refs log tree commit diff
path: root/src/librustc_const_eval
AgeCommit message (Collapse)AuthorLines
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
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-38/+22
possible
2016-06-09fix damage in librustcAriel Ben-Yehuda-2/+3
2016-06-09handle string literals correctly in match checkingAriel Ben-Yehuda-75/+112
The root of the problem is that a string literal pattern is essentially of the form `&LITERAL`, in a single block, while match checking wants to split that. To fix that, I added a type field to the patterns in match checking, which allows us to distinguish between a full and split pattern. That file is ugly and needs to be cleaned. However, `trans::_match` calls it, so I think we should delay the cleanup until we kill that. Fixes #30240
2016-06-09implement RFC495 semantics for slice patternsAriel Ben-Yehuda-58/+45
non-MIR translation is still not supported for these and will happily ICE. This is a [breaking-change] for many uses of slice_patterns.
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-06-01Fix E0165 code examplesGuillaume Gomez-3/+4
2016-05-30Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomezManish Goregaokar-1/+3
Fix compile_fail tag Fixes #33780 r? @steveklabnik
2016-05-28Refactor away some functions from hir::pat_utilVadim Petrochenkov-26/+20
2016-05-28Separate bindings from other patterns in HIRVadim Petrochenkov-63/+44
2016-05-27* Fix compile_fail tag (in some cases, it compiled whereas it wasn't ↵Guillaume Gomez-1/+3
expected to and was still considered 'ok') * Fix error explanations tests/tags
2016-05-26Replace pat_adjust_pos with an iterator adapterVadim Petrochenkov-3/+2
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-16/+27
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-16Remove hir::IdentVadim Petrochenkov-4/+4
2016-05-12Add more details and examples in error codeggomez-4/+9
2016-05-11Rollup merge of #33260 - mrmiywj:help-on-pattern-guard, r=guillaumegomezSteve Klabnik-10/+51
add help on pattern guard
2016-05-11rustc: Split local type contexts interners from the global one.Eduard Burtescu-10/+8
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-54/+51
2016-05-11rustc: Remove the TyCtxt field from ParameterEnvironment.Eduard Burtescu-1/+1
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-21/+27
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-36/+35
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-11/+10
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-03Rollup merge of #33323 - birkenfeld:issue-31221, r=ManishearthManish Goregaokar-2/+21
match check: note "catchall" patterns in unreachable error Caught as catchall patterns are: * unconditional name bindings * references to them * tuple bindings with catchall elements Fixes #31221.
2016-05-03add help on pattern guardmrmiywj-10/+51
fix too long column fix typo of help on pattern guard one nit fix compile fail
2016-05-02replace fileline_{help,note} with {help,note}Niko Matsakis-1/+1
The extra filename and line was mainly there to keep the indentation relative to the main snippet; now that this doesn't include filename/line-number as a prefix, it is distracted.
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`