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

use fully qualified names in wasm_bindgen_test for items exported from std prelude #3549

Merged
merged 3 commits into from
Aug 7, 2023

Conversation

hlbarber
Copy link
Contributor

@hlbarber hlbarber commented Aug 6, 2023

Motivation

Currently, the wasm_bindgen_test macro dooes not use fully qualified names for items exported from the prelude. This means that naming collisions (struct Some) or the removal of the std library prelude will cause compilation errors.

Solution

  • Identify and use fully qualified names in macros were we previously assumed the Rust std prelude. We use ::core rather than ::std.
  • Add no_implicit_prelude to crates/test-macro/ui-tests/should_panic.rs.

@hlbarber hlbarber marked this pull request as ready for review August 6, 2023 22:17
@hlbarber hlbarber changed the title use fully qualified names in macros for items exported from std prelude use fully qualified names in wasm_bindgen_test for items exported from std prelude Aug 7, 2023
Copy link
Collaborator

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! Great to see macro hygiene improved

@ranile ranile merged commit eb36f9d into rustwasm:main Aug 7, 2023
@hlbarber hlbarber deleted the fully-qualified-some branch August 7, 2023 11:38
hawkw pushed a commit to tokio-rs/tracing that referenced this pull request Aug 17, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
davidbarsky pushed a commit to tokio-rs/tracing that referenced this pull request Sep 26, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
davidbarsky pushed a commit to tokio-rs/tracing that referenced this pull request Sep 27, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
davidbarsky pushed a commit to tokio-rs/tracing that referenced this pull request Sep 27, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
davidbarsky pushed a commit to tokio-rs/tracing that referenced this pull request Sep 27, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
hawkw pushed a commit to tokio-rs/tracing that referenced this pull request Oct 1, 2023
## Motivation

Tests involving `wasm_bindgen_test` currently fail:

https://github.com/tokio-rs/tracing/actions/runs/5756318807/job/15605512576

## Solution

- [x] Use `extern crate wasm_bindgen_test` to side-step `no_implicit_prelude`.
- [x] rustwasm/wasm-bindgen#3549
- [ ] Consume the release `wasm_bindgen_test` containing said change.
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