Skip to content

Implement 'url!(..)' macro#137

Closed
frewsxcv wants to merge 1 commit intomasterfrom
url-macro
Closed

Implement 'url!(..)' macro#137
frewsxcv wants to merge 1 commit intomasterfrom
url-macro

Conversation

@frewsxcv
Copy link
Copy Markdown
Contributor

Fixes #136

Review on Reviewable

@frewsxcv
Copy link
Copy Markdown
Contributor Author

I preemptively opened this because I have a couple questions:

  1. How should tests be structured/organized for compiler plugins?
  2. Should the url crate depend on url_plugin? Wouldn't that create a cyclic dependency?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think for publishing to work you need to have a version dep here too. Not sure

@SimonSapin
Copy link
Copy Markdown
Member

To answer questions:

  1. I don’t think many tests are needed here, one to check that the plugin doesn’t panic and returns something sensible should be enough. It’d have to be in a separate crate so you can use the plugin. Cargo will compile a separate crate (run a separate rustc --test invocation) if you have a file named e.g. plugin/tests/smoke_test.rs, so you don’t need another Cargo.toml file.
  2. No it shouldn’t, why? Yes it would.

The code looks ok but (sorry I didn’t mention this earlier) I wonder if this plugin should be here rather than in Servo. We can move it back if someone asks, but in the meantime I don’t know if anyone else would use it. Meanwhile, this code uses unstable compiler internals (as plugins do) and rust-url is sort of expected to work on Rust Nightly, while Rust-in-Servo is updated less frequently.

To put it more bluntly, moving it to Servo is likely less future work for me :]

@Manishearth
Copy link
Copy Markdown
Member

I wonder if this plugin should be here rather than in Servo

We don't need to ship this crate as part of rust-url. It can be published separately and used only by Servo.

@SimonSapin
Copy link
Copy Markdown
Member

I’m suggesting having this in the servo/servo repository rather than this one, where the Rust version used on CI is updated less frequently. This is not about publishing on crates.io.

@frewsxcv
Copy link
Copy Markdown
Contributor Author

Suggestions on where it should live in Servo?

@SimonSapin
Copy link
Copy Markdown
Member

The plugins crate?

frewsxcv added a commit to frewsxcv/servo that referenced this pull request Nov 20, 2015
@frewsxcv
Copy link
Copy Markdown
Contributor Author

servo/servo#8622

@frewsxcv frewsxcv closed this Nov 20, 2015
@frewsxcv frewsxcv deleted the url-macro branch November 20, 2015 15:20
frewsxcv added a commit to frewsxcv/servo that referenced this pull request Nov 20, 2015
frewsxcv added a commit to frewsxcv/servo that referenced this pull request Nov 20, 2015
frewsxcv added a commit to frewsxcv/servo that referenced this pull request Nov 21, 2015
paulrouget pushed a commit to paulrouget/servo that referenced this pull request Nov 25, 2015
jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this pull request Jun 12, 2017
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…ugin); r=SimonSapin

servo/rust-url#136

servo/rust-url#137

Source-Repo: https://github.com/servo/servo
Source-Revision: ea690a2dff64d1cb4eb668473d62f1bbcb19f7c8

UltraBlame original commit: 5bb91f3403d68562020f7bb5215820646e7cc5c6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…ugin); r=SimonSapin

servo/rust-url#136

servo/rust-url#137

Source-Repo: https://github.com/servo/servo
Source-Revision: ea690a2dff64d1cb4eb668473d62f1bbcb19f7c8

UltraBlame original commit: 5bb91f3403d68562020f7bb5215820646e7cc5c6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…ugin); r=SimonSapin

servo/rust-url#136

servo/rust-url#137

Source-Repo: https://github.com/servo/servo
Source-Revision: ea690a2dff64d1cb4eb668473d62f1bbcb19f7c8

UltraBlame original commit: 5bb91f3403d68562020f7bb5215820646e7cc5c6
@DenisGorbachev
Copy link
Copy Markdown

The url! macro for compile-time validation is now available via url-macro crate.

Disclaimer: I'm the author.

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.

4 participants