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

Fix macro hygiene #694

Merged
merged 1 commit into from Jul 15, 2023
Merged

Fix macro hygiene #694

merged 1 commit into from Jul 15, 2023

Conversation

teohhanhui
Copy link
Contributor

Re-export Ok and Err

@teohhanhui
Copy link
Contributor Author

teohhanhui commented Jul 12, 2023

Easy way to trigger the problem:

use anyhow::Ok;
use uuid::{uuid, Uuid};

const SOME_UUID: Uuid = uuid!("00000000-0000-0000-0000-000000000000");

Example of error message when running into this macro hygiene issue:

error[E0532]: expected tuple struct or tuple variant, found function `Ok`

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

@teohhanhui
Copy link
Contributor Author

ping @KodrAus

@KodrAus
Copy link
Member

KodrAus commented Jul 14, 2023

Thanks for the PR @teohhanhui!

This looks good to me, but would you be happy to add a test case here that exercises it? You could replace the anyhow::Ok in your repro with type Ok = () or something like that.

Re-export Ok and Err
@teohhanhui
Copy link
Contributor Author

Done.

Copy link
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this up @teohhanhui!

@KodrAus KodrAus merged commit bd7df72 into uuid-rs:main Jul 15, 2023
19 checks passed
@teohhanhui teohhanhui deleted the fix/macro-hygiene branch July 15, 2023 04:00
kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Jul 17, 2023
Bumps uuid from 1.4.0 to 1.4.1.

Release notes
Sourced from uuid's releases.

1.4.1
What's Changed

Fix macro hygiene by @​teohhanhui in uuid-rs/uuid#694
Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes by @​jrose-signal in uuid-rs/uuid#693
Print uuids in examples by @​KodrAus in uuid-rs/uuid#697
Prepare for 1.4.1 release by @​KodrAus in uuid-rs/uuid#698

New Contributors

@​teohhanhui made their first contribution in uuid-rs/uuid#694
@​jrose-signal made their first contribution in uuid-rs/uuid#693

Full Changelog: uuid-rs/uuid@1.4.0...1.4.1



Commits

97b7f07 Merge pull request #698 from uuid-rs/cargo/1.4.1
8e930cf prepare for 1.4.1 release
0041b3b Merge pull request #697 from uuid-rs/chore/example-printing
5a1f3f5 use uuid_unstable
6b0cfb2 Merge pull request #693 from jrose-signal/inline-from_bytes
33f6b3e print uuids in examples
bd7df72 Merge pull request #694 from teohhanhui/fix/macro-hygiene
1d1ae31 Fix macro hygiene
317d925 Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes
See full diff in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
akrantz01 pushed a commit to akrantz01/lers that referenced this pull request Jul 17, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [uuid](https://togithub.com/uuid-rs/uuid) | dependencies | minor |
`1.3.4` -> `1.4.1` |

---

### Release Notes

<details>
<summary>uuid-rs/uuid (uuid)</summary>

### [`v1.4.1`](https://togithub.com/uuid-rs/uuid/releases/tag/1.4.1)

[Compare
Source](https://togithub.com/uuid-rs/uuid/compare/1.4.0...1.4.1)

#### What's Changed

- Fix macro hygiene by
[@&#8203;teohhanhui](https://togithub.com/teohhanhui) in
[uuid-rs/uuid#694
- Add #\[inline] for Uuid::from_bytes\[\_ref] and Uuid::{as,into}\_bytes
by [@&#8203;jrose-signal](https://togithub.com/jrose-signal) in
[uuid-rs/uuid#693
- Print uuids in examples by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#697
- Prepare for 1.4.1 release by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#698

#### New Contributors

- [@&#8203;teohhanhui](https://togithub.com/teohhanhui) made their first
contribution in
[uuid-rs/uuid#694
- [@&#8203;jrose-signal](https://togithub.com/jrose-signal) made their
first contribution in
[uuid-rs/uuid#693

**Full Changelog**:
uuid-rs/uuid@1.4.0...1.4.1

### [`v1.4.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.4.0)

[Compare
Source](https://togithub.com/uuid-rs/uuid/compare/1.3.4...1.4.0)

#### What's Changed

- Fixed wasm tests not running due to incorrect attribute target by
[@&#8203;kmusick](https://togithub.com/kmusick) in
[uuid-rs/uuid#688
- Fixing issue with Cloudflare Workers and wasm32-unknown-unknown when
using now() by [@&#8203;kmusick](https://togithub.com/kmusick) in
[uuid-rs/uuid#690
- Add `borsh` support by
[@&#8203;grovesNL](https://togithub.com/grovesNL) in
[uuid-rs/uuid#686
- Fix some timestamp generation by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#691
- Prepare for 1.4.0 release by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#692

#### New Contributors

- [@&#8203;kmusick](https://togithub.com/kmusick) made their first
contribution in
[uuid-rs/uuid#688
- [@&#8203;grovesNL](https://togithub.com/grovesNL) made their first
contribution in
[uuid-rs/uuid#686

**Full Changelog**:
uuid-rs/uuid@1.3.4...1.4.0

</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/akrantz01/lers).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
crapStone added a commit to Calciumdibromid/CaBr2 that referenced this pull request Jul 17, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [uuid](https://github.com/uuid-rs/uuid) | dependencies | patch | `1.4.0` -> `1.4.1` |

---

### Release Notes

<details>
<summary>uuid-rs/uuid (uuid)</summary>

### [`v1.4.1`](https://github.com/uuid-rs/uuid/releases/tag/1.4.1)

[Compare Source](uuid-rs/uuid@1.4.0...1.4.1)

#### What's Changed

-   Fix macro hygiene by [@&#8203;teohhanhui](https://github.com/teohhanhui) in uuid-rs/uuid#694
-   Add #\[inline] for Uuid::from_bytes\[\_ref] and Uuid::{as,into}\_bytes by [@&#8203;jrose-signal](https://github.com/jrose-signal) in uuid-rs/uuid#693
-   Print uuids in examples by [@&#8203;KodrAus](https://github.com/KodrAus) in uuid-rs/uuid#697
-   Prepare for 1.4.1 release by [@&#8203;KodrAus](https://github.com/KodrAus) in uuid-rs/uuid#698

#### New Contributors

-   [@&#8203;teohhanhui](https://github.com/teohhanhui) made their first contribution in uuid-rs/uuid#694
-   [@&#8203;jrose-signal](https://github.com/jrose-signal) made their first contribution in uuid-rs/uuid#693

**Full Changelog**: uuid-rs/uuid@1.4.0...1.4.1

</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 [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Co-authored-by: crapStone <crapstone01@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1962
Reviewed-by: crapStone <crapstone01@gmail.com>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
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

2 participants