Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

able to invoke unstable macro 2.0 #34079

Closed
durka opened this issue Jun 4, 2016 · 7 comments · Fixed by #48524 or #62042
Closed

able to invoke unstable macro 2.0 #34079

durka opened this issue Jun 4, 2016 · 7 comments · Fixed by #48524 or #62042
Assignees
Labels
A-macros-2.0 Area: Declarative macros 2.0 (#39412) A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug.

Comments

@durka
Copy link
Contributor

durka commented Jun 4, 2016

Stability checking for macro_rules! was fixed in #48524, but uses of declarative macros 2.0 (macro items) are still not checked for stability.

ORIGINAL ISSUE:

Why does this compile?

fn main() {
    __thread_local_inner!(i32, 42);
}

__thread_local_inner is marked #[unstable(...)] #[allow_internal_unstable].

@petrochenkov
Copy link
Contributor

Because macros are not checked for stability!
At least this was the case when I made stability annotations on public macros mandatory in hopes of a better future.

@steveklabnik steveklabnik added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-stability Area: `#[stable]`, `#[unstable]` etc. labels Jun 6, 2016
@jseyfried
Copy link
Contributor

cc me

@jseyfried jseyfried self-assigned this Jan 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 25, 2017
@abonander
Copy link
Contributor

I'm looking into implementing this, however are we just looking at macro_rules! macros for now or proc-macro and syntax extension invocations as well?

cc @nrc

bors added a commit that referenced this issue Mar 1, 2018
check stability of macro invocations

I haven't implemented tests yet but this should be a pretty solid prototype. I think as-implemented it will also stability-check macro invocations in the same crate, dunno if we want that or not.

I don't know if we want this to go through `rustc::middle::stability` or not, considering the information there wouldn't be available at the time of macro expansion (even for external crates, right?).

r? @nrc
closes #34079
cc @petrochenkov @durka @jseyfried #38356
bors added a commit that referenced this issue Mar 16, 2018
check stability of macro invocations

I haven't implemented tests yet but this should be a pretty solid prototype. I think as-implemented it will also stability-check macro invocations in the same crate, dunno if we want that or not.

I don't know if we want this to go through `rustc::middle::stability` or not, considering the information there wouldn't be available at the time of macro expansion (even for external crates, right?).

r? @nrc
closes #34079
cc @petrochenkov @durka @jseyfried #38356
@petrochenkov
Copy link
Contributor

@abonander
I'm reopening this because macros 2.0 (macro items) are not checked for stability yet.

@petrochenkov petrochenkov reopened this Mar 16, 2018
@abonander
Copy link
Contributor

@petrochenkov do you want to edit the issue/title/labels to reflect that since this still looks like it's for macro_rules! macros? Or should we just open a new issue?

@petrochenkov petrochenkov added A-macros-2.0 Area: Declarative macros 2.0 (#39412) and removed A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Mar 19, 2018
@petrochenkov petrochenkov changed the title able to invoke unstable macro able to invoke unstable macro 2.0 Mar 19, 2018
@petrochenkov
Copy link
Contributor

@abonander
Updated.

@petrochenkov
Copy link
Contributor

Fixed in #62042

Centril added a commit to Centril/rust that referenced this issue Jul 7, 2019
Support stability and deprecation checking for all macros

RELNOTES: Deprecation attributes on macros now have effect.

Fixes rust-lang#34079
Fixes rust-lang#49912
Unblocks rust-lang#62086
Unblocks rust-lang#61000
Centril added a commit to Centril/rust that referenced this issue Jul 7, 2019
Support stability and deprecation checking for all macros

RELNOTES: Deprecation attributes on macros now have effect.

Fixes rust-lang#34079
Fixes rust-lang#49912
Unblocks rust-lang#62086
Unblocks rust-lang#61000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros-2.0 Area: Declarative macros 2.0 (#39412) A-stability Area: `#[stable]`, `#[unstable]` etc. C-bug Category: This is a bug.
Projects
None yet
6 participants