-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
invalid_from_utf8_unchecked
does not fail for include_bytes!
#115208
Comments
Isn't this the purpose of |
invalid_from_utf8_unchecked
does not fail for include_bytes!
That's not the point. A literal sequence of bytes known at compile time should fail if invalid utf8 is found, no matter how it's loaded.
What's a text file? How can you tell it apart from any other file? |
Rollup merge of rust-lang#115257 - Urgau:invalid-utf8-walk-up-hir, r=Nilstrieb Improve invalid UTF-8 lint by finding the expression initializer This PR introduce a small mechanism to walk up the HIR through bindings, if/else, consts, ... when trying lint on invalid UTF-8. Fixes rust-lang#115208
This code should fail if invalid.txt contains invalid UTF-8.
This should fail as the byte sequence is known at compile time!
The text was updated successfully, but these errors were encountered: