Skip to content

suggest using pub(crate) for E0364 #145166

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makai410
Copy link
Contributor

@makai410 makai410 commented Aug 9, 2025

@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Aug 9, 2025
@rust-log-analyzer

This comment has been minimized.

Comment on lines 96 to 98
resolve_consider_marking_as_pub_crate =
or if you want to use the macro within this crate only, reduce the visibility to `pub(crate)`

Copy link
Member

@Kivooeo Kivooeo Aug 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at all other resolve_consider_* error messages I found this addition pretty inconsistent with others, all of them starts with "consider" except this one, is there is no particalr reason for it, could you please rewrite it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just make it align with resolve_consider_marking_as_pub, and "resolve" probably is taken from "rustc_resolve"

Copy link
Member

@Kivooeo Kivooeo Aug 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I see, sounds reasonable but I wonder if something like that could probably work here?

resolve_consider_adding_macro_export =
   consider adding a `#[macro_export]` to the macro in the imported module
   .help = or if you want to use the macro within this crate only, reduce the visibility to `pub(crate)`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not modular enough then IMO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a regression test, a nice-to-have addition would be a link to the original issue

@@ -11,6 +11,10 @@ LL | / macro_rules! bar {
LL | | () => {};
LL | | }
| |_____^
help: or if you want to use the macro within this crate only, reduce the visibility to `pub(crate)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
help: or if you want to use the macro within this crate only, reduce the visibility to `pub(crate)`
help: in case you want to use the macro within this crate only, reduce the visibility to `pub(crate)`

I feel like the "or" doesn't provide much value here and is not something we do in many other error messages (if at all)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@lcnr
Copy link
Contributor

lcnr commented Aug 13, 2025

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 13, 2025
suggest using `pub(crate)` for E0364
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 13, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

☀️ Try build successful (CI)
Build commit: d9d91c9 (d9d91c9b200cb9e062f3e84ce3e278807e759357, parent: b1b26b834d85e84b46aa8f8f3ce210a1627aa85f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d9d91c9): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.3%, secondary 0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
2.5% [2.2%, 2.8%] 2
Improvements ✅
(primary)
-1.1% [-1.3%, -0.8%] 2
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) -0.3% [-1.3%, 1.3%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 464.328s -> 463.676s (-0.14%)
Artifact size: 377.44 MiB -> 377.33 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teach pub(crate) use for E0364 on macro_rules!
6 participants