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

Remove local_inner_macros usage #570

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

EFanZh
Copy link
Contributor

@EFanZh EFanZh commented Jul 10, 2023

Since we have dropped support for pre-1.30 compilers.

src/macros.rs Outdated
macro_rules! log {
// log!(target: "my_target", Level::Info, key1 = 42, key2 = true; "a {} event", "log");
(target: $target:expr, $lvl:expr, $($key:tt = $value:expr),+; $($arg:tt)+) => ({
let lvl = $lvl;
if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() {
$crate::__private_api_log(
__log_format_args!($($arg)+),
::std::format_args!($($arg)+),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be core.

Suggested change
::std::format_args!($($arg)+),
::core::format_args!($($arg)+),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, log haven’t used core:: anywhere, do I want to introduce the usage here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Never mind, this is already resolved in the code:

log/src/lib.rs

Lines 332 to 333 in e9123d6

#[cfg(all(not(feature = "std"), not(test)))]
extern crate core as std;

Copy link
Contributor Author

@EFanZh EFanZh Jul 10, 2023

Choose a reason for hiding this comment

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

I don’t think this will change what ::std means in macros. Maybe I do need to change ::std to ::core, or something like $crate::__private_api_core::?

Copy link
Contributor Author

@EFanZh EFanZh Jul 10, 2023

Choose a reason for hiding this comment

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

I have replaced ::std with $crate::__private_api::, since the only thing I can trust is $crate.

@EFanZh EFanZh force-pushed the remove-local-inner-macros branch from b0321f9 to 9d052b1 Compare July 10, 2023 16:05
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

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

LGTM. I think we also remove __private_api and use ::core instead, but this way works just as well.

@KodrAus KodrAus merged commit cab1088 into rust-lang:master Jul 10, 2023
14 checks passed
@EFanZh
Copy link
Contributor Author

EFanZh commented Jul 11, 2023

LGTM. I think we also remove __private_api and use ::core instead, but this way works just as well.

I think ::core is not necessarily the core crate from the standard library. Like the log crate can rename core as std, downstream crates can also rename some other crate as core:

extern crate log as core;

fn main() {
    ::core::info!("xxx");
}

See https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f22b3288ec76c436dc4a7a248e346072.

EFanZh pushed a commit to EFanZh/log that referenced this pull request Jul 23, 2023
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits/1.0.25)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@EFanZh EFanZh deleted the remove-local-inner-macros branch August 6, 2023 11:06
renovate bot added a commit to ziyadedher/evm-bench that referenced this pull request Aug 12, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [log](https://togithub.com/rust-lang/log) | dependencies | patch |
`0.4.19` -> `0.4.20` |

---

### Release Notes

<details>
<summary>rust-lang/log (log)</summary>

###
[`v0.4.20`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.19...0.4.20)

- Remove rustversion dev-dependency by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#568
- Remove `local_inner_macros` usage by
[@&#8203;EFanZh](https://togithub.com/EFanZh) in
[rust-lang/log#570

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ziyadedher/evm-bench).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit to knope-dev/knope that referenced this pull request Aug 12, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [log](https://togithub.com/rust-lang/log) | dependencies | patch |
`0.4.19` -> `0.4.20` |

---

### Release Notes

<details>
<summary>rust-lang/log (log)</summary>

###
[`v0.4.20`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.19...0.4.20)

- Remove rustversion dev-dependency by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#568
- Remove `local_inner_macros` usage by
[@&#8203;EFanZh](https://togithub.com/EFanZh) in
[rust-lang/log#570

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/knope-dev/knope).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kbudde pushed a commit to kbudde/bench-metrics that referenced this pull request Aug 12, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [log](https://togithub.com/rust-lang/log) | dependencies | patch |
`0.4.19` -> `0.4.20` |

---

### Release Notes

<details>
<summary>rust-lang/log (log)</summary>

###
[`v0.4.20`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.19...0.4.20)

- Remove rustversion dev-dependency by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#568
- Remove `local_inner_macros` usage by
[@&#8203;EFanZh](https://togithub.com/EFanZh) in
[rust-lang/log#570

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/kbudde/bench-metrics).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
sosthene-nitrokey added a commit to trussed-dev/delog that referenced this pull request Aug 17, 2023
These macros where removed in rust-lang/log#570.
Since 0.4.20, they have been replaced by the ones from the standard library.
We can also use the ones from the standard library.
sosthene-nitrokey added a commit to trussed-dev/delog that referenced this pull request Aug 17, 2023
These macros where removed in rust-lang/log#570.
Since 0.4.20, they have been replaced by the ones from the standard library.
We can also use the ones from the standard library.
fdkevin0 pushed a commit to fdkevin0/fdkevin-cf-bot that referenced this pull request Aug 18, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [log](https://togithub.com/rust-lang/log) | dependencies | patch |
`0.4.17` -> `0.4.20` |

---

### Release Notes

<details>
<summary>rust-lang/log (log)</summary>

###
[`v0.4.20`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.19...0.4.20)

- Remove rustversion dev-dependency by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#568
- Remove `local_inner_macros` usage by
[@&#8203;EFanZh](https://togithub.com/EFanZh) in
[rust-lang/log#570

###
[`v0.4.19`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0419---2023-06-10)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.18...0.4.19)

- Use target_has_atomic instead of the old atomic_cas cfg by
[@&#8203;GuillaumeGomez](https://togithub.com/GuillaumeGomez) in
[rust-lang/log#555
- Put MSRV into Cargo.toml by
[@&#8203;est31](https://togithub.com/est31) in
[rust-lang/log#557

###
[`v0.4.18`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0418---2023-05-28)

[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.17...0.4.18)

- fix markdown links (again) by
[@&#8203;hellow554](https://togithub.com/hellow554) in
[rust-lang/log#513
- add cargo doc to workflow by
[@&#8203;hellow554](https://togithub.com/hellow554) in
[rust-lang/log#515
- Apply Clippy lints by
[@&#8203;hellow554](https://togithub.com/hellow554) in
[rust-lang/log#516
- Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case
by [@&#8203;glandium](https://togithub.com/glandium) in
[rust-lang/log#519
- fix up windows targets by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[rust-lang/log#528
- typo fix by [@&#8203;jiangying000](https://togithub.com/jiangying000)
in
[rust-lang/log#529
- Remove dependency on cfg_if by
[@&#8203;EriKWDev](https://togithub.com/EriKWDev) in
[rust-lang/log#536
- GitHub Workflows security hardening by
[@&#8203;sashashura](https://togithub.com/sashashura) in
[rust-lang/log#538
- Fix build status badge by
[@&#8203;atouchet](https://togithub.com/atouchet) in
[rust-lang/log#539
- Add call_logger to the documentation by
[@&#8203;a1ecbr0wn](https://togithub.com/a1ecbr0wn) in
[rust-lang/log#547
- Use stable internals for key-value API by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[rust-lang/log#550
- Change wording of list of implementations by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#553
- Add std-logger to list of implementations by
[@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in
[rust-lang/log#554
- Add `set_max_level_racy` and gate `set_max_level` by
[@&#8203;djkoloski](https://togithub.com/djkoloski) in
[rust-lang/log#544
- \[doc] src/lib.rs : prefix an unused variable with an underscore by
[@&#8203;OccupyMars2025](https://togithub.com/OccupyMars2025) in
[rust-lang/log#561
- \[doc] src/macros.rs : correct grammar errors of an example in lib
documentation by
[@&#8203;OccupyMars2025](https://togithub.com/OccupyMars2025) in
[rust-lang/log#562

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/fdkevin0/fdkevin-cf-bot).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDIuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNi40MC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kodiakhq bot pushed a commit to X-oss-byte/Nextjs that referenced this pull request Sep 22, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [log](https://togithub.com/rust-lang/log) | workspace.dependencies | patch | `0.4.17` -> `0.4.20` |

---

### Release Notes

<details>
<summary>rust-lang/log (log)</summary>

### [`v0.4.20`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11)

[Compare Source](https://togithub.com/rust-lang/log/compare/0.4.19...0.4.20)

-   Remove rustversion dev-dependency by [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in [rust-lang/log#568
-   Remove `local_inner_macros` usage by [@&#8203;EFanZh](https://togithub.com/EFanZh) in [rust-lang/log#570

### [`v0.4.19`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0419---2023-06-10)

[Compare Source](https://togithub.com/rust-lang/log/compare/0.4.18...0.4.19)

-   Use target_has_atomic instead of the old atomic_cas cfg by [@&#8203;GuillaumeGomez](https://togithub.com/GuillaumeGomez) in [rust-lang/log#555
-   Put MSRV into Cargo.toml by [@&#8203;est31](https://togithub.com/est31) in [rust-lang/log#557

### [`v0.4.18`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0418---2023-05-28)

[Compare Source](https://togithub.com/rust-lang/log/compare/0.4.17...0.4.18)

-   fix markdown links (again) by [@&#8203;hellow554](https://togithub.com/hellow554) in [rust-lang/log#513
-   add cargo doc to workflow by [@&#8203;hellow554](https://togithub.com/hellow554) in [rust-lang/log#515
-   Apply Clippy lints by [@&#8203;hellow554](https://togithub.com/hellow554) in [rust-lang/log#516
-   Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case by [@&#8203;glandium](https://togithub.com/glandium) in [rust-lang/log#519
-   fix up windows targets by [@&#8203;KodrAus](https://togithub.com/KodrAus) in [rust-lang/log#528
-   typo fix by [@&#8203;jiangying000](https://togithub.com/jiangying000) in [rust-lang/log#529
-   Remove dependency on cfg_if by [@&#8203;EriKWDev](https://togithub.com/EriKWDev) in [rust-lang/log#536
-   GitHub Workflows security hardening by [@&#8203;sashashura](https://togithub.com/sashashura) in [rust-lang/log#538
-   Fix build status badge by [@&#8203;atouchet](https://togithub.com/atouchet) in [rust-lang/log#539
-   Add call_logger to the documentation by [@&#8203;a1ecbr0wn](https://togithub.com/a1ecbr0wn) in [rust-lang/log#547
-   Use stable internals for key-value API by [@&#8203;KodrAus](https://togithub.com/KodrAus) in [rust-lang/log#550
-   Change wording of list of implementations by [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in [rust-lang/log#553
-   Add std-logger to list of implementations by [@&#8203;Thomasdezeeuw](https://togithub.com/Thomasdezeeuw) in [rust-lang/log#554
-   Add `set_max_level_racy` and gate `set_max_level` by [@&#8203;djkoloski](https://togithub.com/djkoloski) in [rust-lang/log#544
-   \[doc] src/lib.rs : prefix an unused variable with an underscore by [@&#8203;OccupyMars2025](https://togithub.com/OccupyMars2025) in [rust-lang/log#561
-   \[doc] src/macros.rs :  correct  grammar errors of an example in lib documentation by [@&#8203;OccupyMars2025](https://togithub.com/OccupyMars2025) in [rust-lang/log#562

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/sammyfilly/Nextjs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants