Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for `custom_attribute` features #29642
Comments
aturon
added
T-lang
B-unstable
labels
Nov 5, 2015
aturon
changed the title
Tracking issue for `custom_attribute` feature
Tracking issue for `custom_attribute`, `rustc_attrs` features
Nov 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Is this feature ever going to be stabilized? It is currently used by Rocket: SergioBenitez/Rocket#19 (comment). Does Rocket have alternatives? |
This comment has been minimized.
This comment has been minimized.
|
Isn't this part of macros 2.0? that is |
oherrala
referenced this issue
Mar 13, 2017
Closed
Compilation fail using Rust nightly: The attribute `export_macro` is currently unknown to the compiler and may have meaning added to it in the future #55
ctz
referenced this issue
Mar 13, 2017
Closed
The attribute `export_macro` is currently unknown to the compiler #40487
This comment has been minimized.
This comment has been minimized.
beamspease
commented
Mar 16, 2017
|
Just found this ticket as serde's main documentation says to use it... |
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
thijsc
commented
May 17, 2018
|
It seems like serde relies on this feature a lot, see: https://serde.rs/attributes.html Is the plan to stabilize this? |
thijsc
referenced this issue
May 17, 2018
Closed
The attribute `serde` is currently unknown to the compiler #1261
lucatrv
referenced this issue
Nov 6, 2018
Closed
[Rust 2018] cannot use `pest` `#[grammar = "..."]` without `#[macro_use] extern crate pest_derive;` #55735
ghost
referenced this issue
Nov 17, 2018
Open
Transitioning a 3rd party crate (conrod) to 2018 edition #56029
Centril
added
I-nominated
and removed
I-nominated
labels
Jan 13, 2019
Centril
changed the title
Tracking issue for `custom_attribute`, `rustc_attrs` features
Tracking issue for `custom_attribute` features
Jan 17, 2019
nikomatsakis
added
the
T-compiler
label
Jan 17, 2019
This comment has been minimized.
This comment has been minimized.
|
If this is no longer for |
nikomatsakis
removed
the
T-lang
label
Jan 17, 2019
This comment has been minimized.
This comment has been minimized.
|
Discussed in the @rust-lang/lang meeting: We believe we should remove the I think this is the main chunk of code that would change: rust/src/librustc_resolve/macros.rs Lines 316 to 322 in daa53a5 Nominating for @rust-lang/compiler mainly to see if anybody wants to follow-up or mentor this. |
This comment has been minimized.
This comment has been minimized.
|
There are some applicable mentoring instructions here: https://forge.rust-lang.org/stabilization-guide.html However, these instructions are oriented towards stabilizing a feature. We want to remove the feature. The main question mark for me is what sort of error we want to give. @cramertj had some ideas here. Also: cc @dtolnay in case you can think of any problems with removing this. =) |
This comment has been minimized.
This comment has been minimized.
|
This does not include |
This comment has been minimized.
This comment has been minimized.
|
The way If you search the rust codebase for
A usual error about unresolved name? (I'll happily do the necessary work, it's already in my work queue.) |
petrochenkov
self-assigned this
Jan 17, 2019
This comment has been minimized.
This comment has been minimized.
Interesting; could you elaborate a bit on the semantics of this? |
This comment has been minimized.
This comment has been minimized.
|
@Centril |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the ping @nikomatsakis. I don't know of any code using custom_attribute and I don't have any reason to keep it. |
Electron100
referenced this issue
Jan 21, 2019
Closed
#![feature(custom_attribute)] prevents compilation on stable #1
This comment has been minimized.
This comment has been minimized.
|
That sounds like a reasonable step forward. I did do a quick ripgrep through the rust sources and I was surprised by how many uses there are -- did you look more deeply at how e.g. Regarding the rustc internal tests, I suspect we could also get by by adding a few fixed attributes (e.g., But that wouldn't accommodate the |
This comment has been minimized.
This comment has been minimized.
Is this "lint API" for user defined lints? Can you elaborate on that (examples would be nice...)? |
This comment has been minimized.
This comment has been minimized.
|
It is. It is also nowhere near stable, of course. I don't really remember the details -- basically there is some hook and you can invoke some methods to inject lints that the compiler will later run. Here is the example that @SimonSapin gave: (I presume that Clippy doesn't use any custom attributes? cc @oli-obk @Manishearth) |
This comment has been minimized.
This comment has been minimized.
|
Clippy does, but it declares them beforehand, and they're all scoped under |
This comment has been minimized.
This comment has been minimized.
|
Oh, it doesn't, my bad. But they do have a use case there. Either way, we could scope them. |
This comment has been minimized.
This comment has been minimized.
|
Clippy can use "tool attributes" In the future such attributes are supposed to be registered through command line like |
This comment has been minimized.
This comment has been minimized.
|
Hmm... even if we had an API for defining lints, would that actually be of use since this depends on the HIR (and the type system... from what I can see, or at least it needs to operate on more than syntax?) ? (also I was hoping for a more "here is what I think using the API would look like for an end user on stable..." =P ) |
This comment has been minimized.
This comment has been minimized.
|
I submitted #57921 to move this story further. |
This comment has been minimized.
This comment has been minimized.
We probably should address the (Unless our plan is to somehow use the same new machinery for both cases...?) |
aturon commentedNov 5, 2015
Part of RFC 572. This issue tracks stabilization/deprecation.