Skip to content

Conversation

@eopb
Copy link
Contributor

@eopb eopb commented Sep 3, 2024

Thanks for googletest-rust. It's been awesome to use 🙌

Currently, expect_that! doesn't work unless both verify_eq! and verify_that are in scope.

This is okay or users of the prelude, but not for those who don't.

I've noticed that googletest-rust has a number of other macro hygiene issues, but to avoid making an overly large PR, I'll address them as I come across them.

Currently, `expect_that!` doesn't work unless both `verify_eq!` and `verify_that` are in scope.

This is okay or users of the prelude, but not for those who don't.

I've noticed that googletest-rust has a number of other macro hygiene issue, but to avoid making an overly large PR, I'll address them as I come across them.
eopb added a commit to eopb/googletest-rust that referenced this pull request Sep 3, 2024
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/googletest-rust that referenced this pull request Sep 3, 2024
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/cargo-override that referenced this pull request Sep 4, 2024
This requires extra imports because googletest macros look for items in the local scope.

I've opened a PR to fix this google/googletest-rust#475

Once that is released, the extra imports will become unused.
eopb added a commit to eopb/cargo-override that referenced this pull request Sep 4, 2024
This requires extra imports because googletest macros look for items in the local scope.

I've opened a PR to fix this google/googletest-rust#475

Once that is released, the extra imports will become unused.
@gribozavr
Copy link
Collaborator

Thank you for the PR! Unfortunately it fell through the cracks and we didn't notice it. In the meantime other contributors have submitted similar fixes as well as the macro_hygiene.rs test that will make sure this aspect does not regress going forward.

@gribozavr gribozavr closed this Feb 16, 2025
eopb added a commit to eopb/googletest-rust that referenced this pull request Feb 17, 2025
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/googletest-rust that referenced this pull request Feb 17, 2025
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/googletest-rust that referenced this pull request Feb 17, 2025
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
eopb added a commit to eopb/googletest-rust that referenced this pull request Feb 17, 2025
related google#475

I went for using fully qualified method names, rather than `use $crate::GoogleTestSupport as _;` since it's more hygienic.

`use $crate::GoogleTestSupport as _;` can cause issues, resulting in a conflict, if the user introduces another method with the same name as one on `GoogleTestSupport`
@eopb
Copy link
Contributor Author

eopb commented Feb 17, 2025

Thank you for the PR! Unfortunately it fell through the cracks and we didn't notice it. In the meantime other contributors have submitted similar fixes as well as the macro_hygiene.rs test that will make sure this aspect does not regress going forward.

No worries. It's great to see the hygiene has improved since :)

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.

2 participants