-
Notifications
You must be signed in to change notification settings - Fork 13k
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
std: Remove the as_utf16_p functions #14611
Conversation
Hm, that would definitely influence this design, but not by a huge amount though. I think that I'd replace If |
@huonw It's not 100% done yet, but I went ahead and submitted a PR :) |
ping r? I think that this change can be done independently of adding a utf16 iterator (it would just change a few spots). |
These functions are all much better expressed via RAII using the to_utf16() method on strings. This refactoring also takes this opportunity to properly handle when filenames aren't valid unicode when passed through to the windows I/O layer by properly returning I/O errors. All previous users of the `as_utf16_p` or `as_utf16_mut_p` functions will need to convert their code to using `foo.to_utf16().append_one(0)` to get a null-terminated utf16 string. [breaking-change]
Closes #14611 (std: Remove the as_utf16_p functions) Closes #14694 (Num cleanup) Closes #14760 (Add --color to test binary options) Closes #14763 (std: Move dynamic_lib from std::unstable to std) Closes #14766 (Add test for issue #13446) Closes #14769 (collections: Add missing Default impls) Closes #14773 (General nits) Closes #14776 (rustdoc: Correctly classify enums/typedefs)
Closes #14358. The tests are not yet moved to `utf16_iter`, so this probably won't compile. I'm submitting this PR anyway so it can be reviewed and since it was mentioned in #14611. This deprecates `.to_utf16`. `x.to_utf16()` should be replaced by either `x.utf16_iter().collect::<Vec<u16>>()` (the type annotation may be optional), or just `x.utf16_iter()` directly, if it can be used in an iterator context. [breaking-change] cc @huonw
Closes #14358. ~~The tests are not yet moved to `utf16_iter`, so this probably won't compile. I'm submitting this PR anyway so it can be reviewed and since it was mentioned in #14611.~~ EDIT: Tests now use `utf16_iter`. This deprecates `.to_utf16`. `x.to_utf16()` should be replaced by either `x.utf16_iter().collect::<Vec<u16>>()` (the type annotation may be optional), or just `x.utf16_iter()` directly, if it can be used in an iterator context. [breaking-change] cc @huonw
…ments, r=Veykril mbe: fix token conversion for doc comments fixes rust-lang#14611 when creating token trees for the converted doc comment, we should use the correct span in all places, rather than allowing some to remain unspecified. otherwise, things behave incorrectly.
These functions are all much better expressed via RAII using the to_utf16()
method on strings. This refactoring also takes this opportunity to properly
handle when filenames aren't valid unicode when passed through to the windows
I/O layer by properly returning I/O errors.
All previous users of the
as_utf16_p
oras_utf16_mut_p
functions will needto convert their code to using
foo.to_utf16().append_one(0)
to get anull-terminated utf16 string.
[breaking-change]