Skip to content

Encapsulate unsafe in _cssparser_internal_to_lowercase macro #335

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

Merged
merged 3 commits into from
Apr 30, 2023

Conversation

nicoburns
Copy link
Contributor

@nicoburns nicoburns commented Apr 30, 2023

Objective

  • Allow the _cssparser_internal_to_lowercase macro to be used in crates that set #[forbid(unsafe)].
  • Document the safety invariant for this unsafe block

Changes made

  • Wrap the unsafe block in the _cssparser_internal_to_lowercase macro in an #[inline(always)] function.
  • Add comments

Context

This allows it to be used in codebases with #[forbid(unsafe)].
Also document the safety invariant for the unsafe block
@SimonSapin
Copy link
Member

Oh, good idea! This is now possible with const generics

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 39ea1b0 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

⌛ Testing commit 39ea1b0 with merge b0c1761...

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: SimonSapin
Pushing b0c1761 to master...

@bors-servo bors-servo merged commit b0c1761 into servo:master Apr 30, 2023
@nicoburns nicoburns deleted the encapsulate-unsafe-in-macro branch April 30, 2023 15:31
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.

3 participants