-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Clarify WTF-8 safety docs #140936
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
Clarify WTF-8 safety docs #140936
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
The comment change looks good. Can you rewrap it to 80 columns, though? There's no reason not to, since you're already touching the whole paragraph. I'm not convinced that the That being said, here are some alternatives that I think would be better than
The last three would import the module like Semantically, I prefer “impl” the most, because these are platform adaptors implementing a common interface. “Inner” works, as they're indeed the inner types of One thing I like about these names over I think it's worth fleshing out name ideas more, but I'm currently leaning towards keeping the current names. |
28b9300
to
8f0522d
Compare
Done!
This seems like it could end up being a bikeshed, and it's a different type of change, so I've dropped that commit. |
This looks fine to me, but would like a second look. r? @workingjubilee |
Thanks! @bors r+ rollup |
…kingjubilee Clarify WTF-8 safety docs This PR is a follow-up to PR rust-lang#140159, which clarifies ~~two things~~: - the WTF-8 safety comment [was confusing](rust-lang#140159 (comment)), either surrogate condition is actually sufficient for safety, both are not required - ~~the private `os_str::Slice` type name is easily confused with `std::slice`~~ ~~Happy to bikeshed the `OsSlice` name, other alternatives are `OsStrSlice` and `StrSlice`. Now it's got a distinct name from `std::slice`, it's easy to search and replace.~~ cc `@thaliaarchi` `@workingjubilee`
Rollup of 9 pull requests Successful merges: - #134696 (Implement `normalize_lexically`) - #138744 (Add methods to TCP and UDP sockets to modify hop limit (refresh of #94678)) - #140539 (Simplify `attribute_groups`) - #140863 ([rustdoc] Unify type aliases rendering with other ADT) - #140936 (Clarify WTF-8 safety docs) - #140952 (Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace) - #141472 (Attempt to improve the `std::fs::create_dir_all` docs related to atomicity) - #141502 (ci: move PR job x86_64-gnu-tools to codebuild) - #141559 (const-check: stop recommending the use of rustc_allow_const_fn_unstable) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 8 pull requests Successful merges: - #134696 (Implement `normalize_lexically`) - #140539 (Simplify `attribute_groups`) - #140863 ([rustdoc] Unify type aliases rendering with other ADT) - #140936 (Clarify WTF-8 safety docs) - #140952 (Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace) - #141472 (Attempt to improve the `std::fs::create_dir_all` docs related to atomicity) - #141502 (ci: move PR job x86_64-gnu-tools to codebuild) - #141559 (const-check: stop recommending the use of rustc_allow_const_fn_unstable) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #140936 - teor2345:wtf-surrogate-docs, r=workingjubilee Clarify WTF-8 safety docs This PR is a follow-up to PR #140159, which clarifies ~~two things~~: - the WTF-8 safety comment [was confusing](#140159 (comment)), either surrogate condition is actually sufficient for safety, both are not required - ~~the private `os_str::Slice` type name is easily confused with `std::slice`~~ ~~Happy to bikeshed the `OsSlice` name, other alternatives are `OsStrSlice` and `StrSlice`. Now it's got a distinct name from `std::slice`, it's easy to search and replace.~~ cc ``@thaliaarchi`` ``@workingjubilee``
…kingjubilee Clarify WTF-8 safety docs This PR is a follow-up to PR rust-lang#140159, which clarifies ~~two things~~: - the WTF-8 safety comment [was confusing](rust-lang#140159 (comment)), either surrogate condition is actually sufficient for safety, both are not required - ~~the private `os_str::Slice` type name is easily confused with `std::slice`~~ ~~Happy to bikeshed the `OsSlice` name, other alternatives are `OsStrSlice` and `StrSlice`. Now it's got a distinct name from `std::slice`, it's easy to search and replace.~~ cc ``@thaliaarchi`` ``@workingjubilee``
This PR is a follow-up to PR #140159, which clarifies
two things:the privateos_str::Slice
type name is easily confused withstd::slice
Happy to bikeshed theOsSlice
name, other alternatives areOsStrSlice
andStrSlice
. Now it's got a distinct name fromstd::slice
, it's easy to search and replace.cc @thaliaarchi @workingjubilee