Skip to content

Conversation

@yaahc
Copy link
Member

@yaahc yaahc commented Nov 26, 2025

Bare minimum impl to probe for issues that need to be resolved before I go and add the feature flag machinery.

This has already exposed a shortcoming in our unreachable_pub lint where it is erroneously firing for some internal macros as pub even tho they don't have path-based scoping on their own.

experiment for #148610

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 26, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this Nov 26, 2025
@yaahc yaahc force-pushed the implicit-pub-macros branch from abaf5eb to 6be80a1 Compare December 12, 2025 21:28
@rust-log-analyzer

This comment has been minimized.

@yaahc yaahc force-pushed the implicit-pub-macros branch from 6be80a1 to 34baa79 Compare December 12, 2025 21:49
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

error: unreachable `pub` item
  --> library/core/src/num/mod.rs:85:1
   |
85 | macro_rules! u8_xe_bytes_doc {
   | -^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: unreachable `pub` item
  --> library/core/src/num/mod.rs:97:1
   |
97 | macro_rules! i8_xe_bytes_doc {
   | -^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: unreachable `pub` item
   --> library/core/src/num/mod.rs:110:1
    |
110 | macro_rules! usize_isize_to_xe_bytes_doc {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

error: unreachable `pub` item
   --> library/core/src/num/mod.rs:121:1
    |
121 | macro_rules! usize_isize_from_xe_bytes_doc {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1599:17
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1599 | |                 macro_rules! unwrap_or_PIE {
     | |                 -^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                 |
     | |                 help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
1665 |
1666 |   from_str_int_impl! { signed isize i8 i16 i32 i64 i128 }
     |   ------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1617:21
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1617 | |                     macro_rules! run_unchecked_loop {
     | |                     -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                     |
     | |                     help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
1665 |
1666 |   from_str_int_impl! { signed isize i8 i16 i32 i64 i128 }
     |   ------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1633:21
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1633 | |                     macro_rules! run_checked_loop {
     | |                     -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                     |
     | |                     help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
1665 |
1666 |   from_str_int_impl! { signed isize i8 i16 i32 i64 i128 }
     |   ------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1599:17
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1599 | |                 macro_rules! unwrap_or_PIE {
     | |                 -^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                 |
     | |                 help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
...
1667 |   from_str_int_impl! { unsigned usize u8 u16 u32 u64 u128 }
     |   --------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1617:21
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1617 | |                     macro_rules! run_unchecked_loop {
     | |                     -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                     |
     | |                     help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
...
1667 |   from_str_int_impl! { unsigned usize u8 u16 u32 u64 u128 }
     |   --------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
    --> library/core/src/num/mod.rs:1633:21
     |
1402 | / macro_rules! from_str_int_impl {
1403 | |     ($signedness:ident $($int_ty:ty)+) => {$(
1404 | |         #[stable(feature = "rust1", since = "1.0.0")]
1405 | |         #[rustc_const_unstable(feature = "const_convert", issue = "143773")]
...    |
1633 | |                     macro_rules! run_checked_loop {
     | |                     -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     | |                     |
     | |                     help: consider restricting its visibility: `pub(crate)`
...    |
1663 | |     )*}
1664 | | }
     | |_- in this expansion of `from_str_int_impl!`
...
1667 |   from_str_int_impl! { unsigned usize u8 u16 u32 u64 u128 }
     |   --------------------------------------------------------- in this macro invocation
     |
     = help: or consider exporting it for use by other crates

error: unreachable `pub` item
---

error: unreachable `pub` item
  --> library/core/src/cmp/bytewise.rs:74:1
   |
74 | macro_rules! is_bytewise_comparable_array_length {
   | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
   --> library/core/src/ops/arith.rs:480:1
    |
480 | macro_rules! div_impl_integer {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

error: unreachable `pub` item
   --> library/core/src/ops/arith.rs:509:1
    |
509 | macro_rules! div_impl_float {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
   --> library/core/src/ops/bit.rs:479:1
    |
479 | macro_rules! shl_impl {
    | -^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
   --> library/core/src/ops/bit.rs:601:1
    |
601 | macro_rules! shr_impl {
    | -^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

error: unreachable `pub` item
   --> library/core/src/ops/bit.rs:621:1
    |
621 | macro_rules! shr_impl_all {
    | -^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
   --> library/core/src/ops/bit.rs:815:1
    |
815 | macro_rules! bitor_assign_impl {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

error: unreachable `pub` item
   --> library/core/src/ops/bit.rs:890:1
    |
890 | macro_rules! bitxor_assign_impl {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
    --> library/core/src/ops/bit.rs:1041:1
     |
1041 | macro_rules! shr_assign_impl {
     | -^^^^^^^^^^^^^^^^^^^^^^^^^^^
     | |
     | help: consider restricting its visibility: `pub(crate)`
     |
     = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
   --> library/core/src/iter/adapters/zip.rs:152:1
    |
152 | macro_rules! zip_impl_general_defaults {
    | -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: consider restricting its visibility: `pub(crate)`
    |
    = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
    --> library/core/src/net/ip_addr.rs:2403:1
     |
2403 | macro_rules! bitop_impls {
     | -^^^^^^^^^^^^^^^^^^^^^^^
     | |
     | help: consider restricting its visibility: `pub(crate)`
     |
     = help: or consider exporting it for use by other crates

---

error: unreachable `pub` item
    --> library/core/src/sync/atomic.rs:2583:1
     |
2583 | macro_rules! if_8_bit {
     | -^^^^^^^^^^^^^^^^^^^^
     | |
     | help: consider restricting its visibility: `pub(crate)`
     |
     = help: or consider exporting it for use by other crates

For more information how to resolve CI failures of this job, visit this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants