Document with_added_extension edge cases - #158051
Merged
Merged
Conversation
Clarified how `with_added_extension` deals with the return value from `add_extension`. I added some "interesting" examples to illustrate.
Collaborator
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
Thanks! @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 18, 2026
Document `with_added_extension` edge cases Clarified how `with_added_extension` deals with the return value from `add_extension`. I added some "interesting" examples to illustrate. IMO this function should have returned `Result` but unfortunately the discussion about that was kind of ignored. :-/ We can at least document it well. No AI was used to make this change.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 18, 2026
Rollup of 8 pull requests Successful merges: - #158056 (Put internal lints into a single combined pass) - #151132 (Take care to use MSG_EOR with SOCK_SEQPACKET sockets) - #157644 (wasm32-wasip1-threads: Correct llvm target name) - #157912 (stabilize str_from_utf16_endian) - #158048 (Revert "add regression test for Redundant memory strores with mut parameters in by-value returns") - #158051 (Document `with_added_extension` edge cases) - #158054 (fix unresolved import suggestion before outer attributes) - #158062 (rustc book: Update wasm32-wasip1-threads's maintainers list)
rust-timer
added a commit
that referenced
this pull request
Jun 18, 2026
Rollup merge of #158051 - Timmmm:patch-1, r=jhpratt Document `with_added_extension` edge cases Clarified how `with_added_extension` deals with the return value from `add_extension`. I added some "interesting" examples to illustrate. IMO this function should have returned `Result` but unfortunately the discussion about that was kind of ignored. :-/ We can at least document it well. No AI was used to make this change.
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.
Clarified how
with_added_extensiondeals with the return value fromadd_extension. I added some "interesting" examples to illustrate.IMO this function should have returned
Resultbut unfortunately the discussion about that was kind of ignored. :-/ We can at least document it well.No AI was used to make this change.