| Age | Commit message (Collapse) | Author | Lines |
|
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
|
|
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.
|
|
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)
|
|
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
|
|
This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.
|
|
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
|
|
|
|
|
|
|
|
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
|
|
Support 16-bit pointers in MIR
|
|
|
|
|
|
possible
|
|
|
|
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
|
|
non-MIR translation is still not supported for these and will happily ICE.
This is a [breaking-change] for many uses of slice_patterns.
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
Fix compile_fail tag
Fixes #33780
r? @steveklabnik
|
|
|
|
|
|
expected to and was still considered 'ok')
* Fix error explanations tests/tags
|
|
|
|
|
|
This is based on the original work of Dylan McKay for the
[avr-rust project][ar].
[ar]: https://github.com/avr-rust/rust
|
|
|
|
|
|
add help on pattern guard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
casting `&[u8]` to `* const u8` doesn't work in const_eval
fixes #33452
r? @eddyb
cc @Ms2ger
|
|
Warn unused trait imports, rebased
Rebase of #30021.
Fix #25730.
|
|
|
|
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
|
|
|
|
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.
|
|
fix too long column
fix typo of help on pattern guard
one nit
fix compile fail
|
|
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.
|
|
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`
|