std: Remove the as_utf16_p functions#14611
Closed
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Closed
std: Remove the as_utf16_p functions#14611alexcrichton wants to merge 1 commit intorust-lang:masterfrom
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Conversation
Contributor
Member
Author
|
Hm, that would definitely influence this design, but not by a huge amount though. I think that I'd replace If |
Closed
Contributor
|
@huonw It's not 100% done yet, but I went ahead and submitted a PR :) |
Member
Author
|
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]
bors
added a commit
that referenced
this pull request
Jun 10, 2014
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)
bors
added a commit
that referenced
this pull request
Jun 17, 2014
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
bors
added a commit
that referenced
this pull request
Jun 30, 2014
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
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 5, 2023
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_poras_utf16_mut_pfunctions will needto convert their code to using
foo.to_utf16().append_one(0)to get anull-terminated utf16 string.
[breaking-change]