-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Suggest from_utf8_unchecked in const contexts #8612
Suggest from_utf8_unchecked in const contexts #8612
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #8610) made this pull request unmergeable. Please resolve the merge conflicts. |
baa272b
to
7a80c23
Compare
|
Oh haha, I don't know how I didn't realize that 😅 . Thanks for pointing it out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one comment, LGTM otherwise.
Co-authored-by: Philipp Krones <hello@philkrones.com>
@bors r+ Thanks! |
📌 Commit 41ef4f7 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Unfortunately I couldn't figure out how to check whether a given expression is in an
unsafe
context or not, so I just unconditionally emit the wrappingunsafe {}
block in the suggestion. If there is an easy way to get it to work better then I would love to hear it.changelog: Suggest
from_utf8_unchecked
instead offrom_utf8
in const contexts for[`transmute_bytes_to_str`]
refs: #8379