exclude unexported macro bindings from extern crate by bvanjoi · Pull Request #119369 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation45 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

bvanjoi

Fixes #119301

Macros that aren't exported from an external crate should not be defined.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Dec 28, 2023

petrochenkov

@petrochenkov

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Dec 28, 2023

@bors

exclude unexported macro bindings from extern crate

Fixes rust-lang#119301

Macros that aren't exported from an external crate should not be defined.

r? @petrochenkov

@bors

☀️ Try build successful - checks-actions
Build commit: 3832a95 (3832a95f57d4260fb5641e183906f49b4e5c6bdd)

1 similar comment

@bors

☀️ Try build successful - checks-actions
Build commit: 3832a95 (3832a95f57d4260fb5641e183906f49b4e5c6bdd)

@petrochenkov

@craterbot

@craterbot

🚧 Experiment pr-119369 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

@petrochenkov

@craterbot

@craterbot

🚧 Experiment pr-119369-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

@bvanjoi

The majority of issues are caused by the usage of the quote which exported from other crates. For instance, such instances occur in leptos_macro:

#[macro_use] extern crate proc_macro_error;

use proc_macro::TokenStream;

#[proc_macro] pub fn view(_a: TokenStream) -> TokenStream { quote!{}; TokenStream::new() }

and the reduced was:

// extern-1 #[macro_export] macro_rules! quote { () => {} }

// extern-2 use extern_1::quote;

// code.rs #[macro_use] extern crate sera_2;

fn main() { quote! {}; }

@bvanjoi

Should we consider adding a lint for this issue?

petrochenkov

@petrochenkov

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jan 18, 2024

@rust-log-analyzer

This comment has been minimized.

petrochenkov

@petrochenkov

r=me with the remaining nits addressed.

@rust-log-analyzer

This comment has been minimized.

@bvanjoi

@petrochenkov

@bors

📌 Commit 9c3091e has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jan 21, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jan 22, 2024

@matthiaskrgr

exclude unexported macro bindings from extern crate

Fixes rust-lang#119301

Macros that aren't exported from an external crate should not be defined.

r? @petrochenkov

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jan 22, 2024

@matthiaskrgr

exclude unexported macro bindings from extern crate

Fixes rust-lang#119301

Macros that aren't exported from an external crate should not be defined.

r? @petrochenkov

This was referenced

Jan 22, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 22, 2024

@bors

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Jan 22, 2024

@rust-timer

Rollup merge of rust-lang#119369 - bvanjoi:fix-119301, r=petrochenkov

exclude unexported macro bindings from extern crate

Fixes rust-lang#119301

Macros that aren't exported from an external crate should not be defined.

r? @petrochenkov

feliperodri added a commit to model-checking/kani that referenced this pull request

Feb 8, 2024

Related PRs so far:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.


Signed-off-by: Felipe R. Monteiro felisous@amazon.com Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: tautschnig tautschnig@users.noreply.github.com Co-authored-by: Qinheping Hu qinhh@amazon.com Co-authored-by: Michael Tautschnig tautschn@amazon.com Co-authored-by: Felipe R. Monteiro felisous@amazon.com

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.