| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
`async_await` was stabilized in 1.39.0, not 1.38.0.
r? @Mark-Simulacrum
|
|
Use dedicated type for spans in pre-expansion gating.
- Simplify the overall pre-expansion gating "experience".
|
|
|
|
|
|
|
|
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`.
This is a partial implementation of RFC 2535.
|
|
|
|
|
|
|
|
Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion infrastructure to elsewhere
As described in https://github.com/rust-lang/rust/pull/62086#issuecomment-515195477.
Reminder:
- `derive(PartialEq, Eq)` makes the type it applied to a "structural match" type, so constants of this type can be used in patterns (and const generics in the future).
- `derive(Copy)` notifies other derives that the type it applied to implements `Copy`, so `derive(Clone)` can generate optimized code and other derives can generate code working with `packed` types and types with `rustc_layout_scalar_valid_range` attributes.
First, the special behavior is now enabled after properly resolving the derives, rather than after textually comparing them with `"Copy"`, `"PartialEq"` and `"Eq"` in `fn add_derived_markers`.
The markers are no longer kept as attributes in AST since derives cannot modify items and previously did it through hacks in the expansion infra.
Instead, the markers are now kept in a "global context" available from all the necessary places, namely - resolver.
For `derive(PartialEq, Eq)` the markers are created by the derive macros themselves and then consumed during HIR lowering to add the `#[structural_match]` attribute in HIR.
This is still a hack, but now it's a hack local to two specific macros rather than affecting the whole expansion infra.
Ideally we should find the way to put `#[structural_match]` on the impls rather than on the original item, and then consume it in `rustc_mir`, then no hacks in expansion and lowering will be required.
(I'll make an issue about this for someone else to solve, after this PR lands.)
The marker for `derive(Copy)` cannot be emitted by the `Copy` macro itself because we need to know it *before* the `Copy` macro is expanded for expanding other macros.
So we have to do it in resolve and block expansion of any derives in a `derive(...)` container until we know for sure whether this container has `Copy` in it or not.
Nasty stuff.
r? @eddyb or @matthewjasper
|
|
|
|
infrastructure to elsewhere
|
|
|
|
|
|
Turn `INCOMPLETE_FEATURES` into lint
We do this because it is annoying to see the warning when building rustc and because this is better from a "separation of concerns" POV.
The drawback to this change is that this will respect `--cap-lints`.
Also note that this is not a buffered lint so if there are fatal parser errors then the lint will not trigger.
r? @varkor
|
|
|
|
|
|
|
|
Update `impl Trait` gate issues
cc https://github.com/rust-lang/rust/issues/63065
cc https://github.com/rust-lang/rust/issues/63063
r? @varkor cc @alexreg
|
|
cleanup: Remove some language features related to built-in macros
They are now library features.
Cleanup after https://github.com/rust-lang/rust/pull/62086.
The unstable book files are moved because tidy complained.
|
|
|
|
They are now library features.
|
|
|
|
|
|
|
|
At the moment, `rustc_private` as a (library) feature exists by
accident: `char::is_xid_start`, `char::is_xid_continue` methods in
libcore define it.
|
|
rustc/rustc_mir: Implement RFC 2203.
This PR implements RFC 2203, allowing constants in array repeat
expressions. Part of #49147.
r? @eddyb
|
|
|
|
Therefore we also remove `#[unsafe_destructor_blind_to_params]`
attribute completly.
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
This commit adds a `const_in_array_repeat_expressions` feature gate and
only create `Candidate::Repeat` if it is enabled.
|
|
rustdoc: set cfg(doctest) when collecting doctests
Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR.
As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.)
Tracking issue: https://github.com/rust-lang/rust/issues/62210
|
|
|
|
|
|
|
|
|
|
|
|
Feature gate `rustc` attributes harder
Fixes https://github.com/rust-lang/rust/issues/62116
|
|
|
|
Switch tracking issue for `#![feature(slice_patterns)]`
Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs.
Closes https://github.com/rust-lang/rust/issues/23121.
r? @varkor
|
|
|
|
Minimizes risk.
|
|
r=petrochenkov
Stabilize `type_alias_enum_variants` in Rust 1.37.0
Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:
```rust
enum Option<T> {
None,
Some(T),
}
type OptAlias<T> = Option<T>;
fn work_on_alias(x: Option<u8>) -> u8 {
match x {
OptAlias::Some(y) => y + 1,
OptAlias::None => 0,
}
}
```
Closes https://github.com/rust-lang/rfcs/issues/2218
Closes https://github.com/rust-lang/rust/issues/52118
r? @petrochenkov
|
|
|