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

exclude unexported macro bindings from extern crate #119369

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Dec 28, 2023

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 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 Dec 28, 2023
@petrochenkov
Copy link
Contributor

@bors try

@petrochenkov petrochenkov added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 28, 2023
@bors
Copy link
Contributor

bors commented Dec 28, 2023

⌛ Trying commit 6b62275 with merge 3832a95...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 28, 2023
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
Copy link
Contributor

bors commented Dec 28, 2023

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

1 similar comment
@bors
Copy link
Contributor

bors commented Dec 28, 2023

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

@petrochenkov
Copy link
Contributor

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-119369 created and queued.
🤖 Automatically detected try build 3832a95
🔍 You can check out the queue and this experiment's details.

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

@craterbot
Copy link
Collaborator

🚧 Experiment pr-119369 is now running

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

@craterbot
Copy link
Collaborator

🎉 Experiment pr-119369 is completed!
📊 1281 regressed and 4 fixed (403354 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 30, 2023
@petrochenkov
Copy link
Contributor

Many "No space left on device" errors, need to run for the second time as usual.
@craterbot check p=1 crates=https://crater-reports.s3.amazonaws.com/pr-119369/retry-regressed-list.txt

@craterbot
Copy link
Collaborator

👌 Experiment pr-119369-1 created and queued.
🤖 Automatically detected try build 3832a95
🔍 You can check out the queue and this experiment's details.

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

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 30, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-119369-1 is now running

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

@craterbot
Copy link
Collaborator

🎉 Experiment pr-119369-1 is completed!
📊 1198 regressed and 0 fixed (1281 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 30, 2023
@bvanjoi
Copy link
Contributor Author

bvanjoi commented Jan 1, 2024

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
Copy link
Contributor Author

bvanjoi commented Jan 1, 2024

Should we consider adding a lint for this issue?

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 18, 2024
compiler/rustc_resolve/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/imports.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/build_reduced_graph.rs Outdated Show resolved Hide resolved
compiler/rustc_resolve/src/build_reduced_graph.rs Outdated Show resolved Hide resolved
@petrochenkov
Copy link
Contributor

The issue still need to be created - #119369 (comment).
@rustbot author

@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.

compiler/rustc_lint_defs/src/builtin.rs Outdated Show resolved Hide resolved
compiler/rustc_lint_defs/src/builtin.rs Outdated Show resolved Hide resolved
compiler/rustc_lint_defs/src/builtin.rs Outdated Show resolved Hide resolved
@petrochenkov
Copy link
Contributor

r=me with the remaining nits addressed.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jan 21, 2024

📌 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
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
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 added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#118578 (core: introduce split_at{,_mut}_checked)
 - rust-lang#119369 (exclude unexported macro bindings from extern crate)
 - rust-lang#119408 (xous: misc fixes + add network support)
 - rust-lang#119943 (std::net: bind update for using backlog as `-1` too.)
 - rust-lang#119948 (Make `unsafe_op_in_unsafe_fn` migrated in edition 2024)
 - rust-lang#119999 (remote-test: use u64 to represent file size)
 - rust-lang#120152 (add help message for `exclusive_range_pattern` error)
 - rust-lang#120213 (Don't actually make bound ty/const for RTN)
 - rust-lang#120225 (Fix -Zremap-path-scope typo)

Failed merges:

 - rust-lang#119972 (Add `ErrCode`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c5984ca into rust-lang:master Jan 22, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2024
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:

- rust-lang/rust#119869
- rust-lang/rust#120080
- rust-lang/rust#120128
- rust-lang/rust#119369
- rust-lang/rust#116672

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 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: tautschnig <[email protected]>
Co-authored-by: Qinheping Hu <[email protected]>
Co-authored-by: Michael Tautschnig <[email protected]>
Co-authored-by: Felipe R. Monteiro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue-80074 test should not compile
6 participants