| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
fixes #51212
|
|
|
|
paths
|
|
[nll] enable feature(nll) on various crates for bootstrap: part 2
#53172
|
|
Avoid unnecessary pattern matching against Option and Result
|
|
|
|
|
|
|
|
|
|
|
|
resolve/expansion: Implement tool attributes
|
|
resolve: Modularize crate-local `#[macro_export] macro_rules`
Based on https://github.com/rust-lang/rust/pull/50911, cc https://github.com/rust-lang/rust/pull/50911#issuecomment-401151270
`#[macro_export] macro_rules` items are collected from the whole crate and are planted into the root module as items, so the external view of the crate is symmetric with its internal view and something like `$crate::my_macro` where `my_macro` is `#[macro_export] macro_rules` works both locally and from other crates.
Closes https://github.com/rust-lang/rust/issues/52726
|
|
Don't format!() string literals
Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
|
|
|
|
|
|
Misc cleanups
|
|
|
|
|
|
|
|
Attach deprecation lint `proc_macro_derive_resolution_fallback` to a specific node id
So it can be `allow`-ed from inside the derive.
cc https://github.com/rust-lang/rust/pull/51952
|
|
Fix loop label resolution around constants
And make `delay_span_bug` a little more helpful
r? @varkor
fixes #52442
fixes #52443
|
|
specific node id
|
|
|
|
Rename `shadows_glob` to `shadowed_glob`
|
|
|
|
Implement existential types
(not for associated types yet)
r? @nikomatsakis
cc @Centril @varkor @alexreg
|
|
|
|
This feature is stable, we shouldn't suggest it any more! Instead suggest the
real feature, `use_extern_macros`.
|
|
This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.
Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!
A summary of the changes made in this PR (as well as the various consequences)
is:
* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
to `use_extern_macros` being enabled. This means that code using
`#![feature(proc_macro)]` today will likely need to move to
`#![feature(use_extern_macros)]`.
It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.
[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
|
|
|
|
|
|
hygiene: Decouple transparencies from expansion IDs
And remove fallback to parent modules during resolution of names in scope.
This is a breaking change for users of unstable macros 2.0 (both procedural and declarative), code like this:
```rust
#![feature(decl_macro)]
macro m($S: ident) {
struct $S;
mod m {
type A = $S;
}
}
fn main() {
m!(S);
}
```
or equivalent
```rust
#![feature(decl_macro)]
macro m($S: ident) {
mod m {
type A = $S;
}
}
fn main() {
struct S;
m!(S);
}
```
stops working due to module boundaries being properly enforced.
For proc macro derives this is still reported as a compatibility warning to give `actix_derive`, `diesel_derives` and `palette_derive` time to fix their issues.
Fixes https://github.com/rust-lang/rust/issues/50504 in accordance with [this comment](https://github.com/rust-lang/rust/issues/50504#issuecomment-399764767).
|
|
The intent here is to resolve #52202.
|
|
|
|
|
|
|
|
hygiene: Implement transparent marks and use them for call-site hygiene in proc-macros
Fixes https://github.com/rust-lang/rust/issues/50050
|
|
Lowering cleanups [1/N]
|
|
|
|
`$crate` is not resolved at def-site of a macro, but rather at "transitive def-site"
|
|
|
|
|
|
|
|
|
|
Remove emulation of hygiene with gensyms
|