Rollup of 11 pull requests#156378
Open
matthiaskrgr wants to merge 24 commits intorust-lang:mainfrom
Open
Conversation
This addition allows an end-user to inspect the environment variables that are visible to the process when it boots.
specifically, do not allow NULL bytes and the empty string
We call `get_switch_int_data` once for the switch and then pass that data to `apply_switch_int_edge_effect` for each switch target. The only case in practice is `MaybePlacesSwitchIntData` which does an awkward thing, maintaining an index into the discriminants and updating it on each call to `apply_switch_int_edge_effect`. This commit changes things to do more work up front in `get_switch_int_data`, in order to then do less work in `apply_switch_int_edge_effect`. This avoids the need for the `variants` and `next_discr` methods and the discriminants index. Overall it's a little simpler.
* Add `str::word_to_titlecase()` to `alloc` * Address review comment
* Add mention of sendfile(2) and splice(2) to fs::copy() documentation. * Oxford comma fix
…s, r=Mark-Simulacrum Add Command::get_resolved_envs This addition allows an end-user to inspect the environment variables that are visible to the process when it boots. Discussed in: - Tracking issue: rust-lang#149070 (partially closes) - ACP: rust-lang/libs-team#194
… r=Mark-Simulacrum Add `str::word_to_titlecase()` to `alloc` A small addition to rust-lang#153892. Hasn't gone through ACP, so needs libs-API signoff. @rustbot label A-Unicode T-libs-api
…riplett Add mention of sendfile(2) and splice(2) to fs::copy() documentation. Fixes rust-lang#155968 by adding mention of sendfile(2) and splice(2) from io::copy()
…=Mark-Simulacrum Update a bunch of bootstrap dependencies to remove windows-target Follow up to rust-lang#155444
…ff, r=cjgillot Change `SwitchInt` handling in dataflow analysis. We call `get_switch_int_data` once for the switch and then pass that data to `apply_switch_int_edge_effect` for each switch target. The only case in practice is `MaybePlacesSwitchIntData` which does an awkward thing, maintaining an index into the discriminants and updating it on each call to `apply_switch_int_edge_effect`. This commit changes things to do more work up front in `get_switch_int_data`, in order to then do less work in `apply_switch_int_edge_effect`. This avoids the need for the `variants` and `next_discr` methods and the discriminants index. Overall it's a little simpler. r? @cjgillot
…lacrum Add regression test for issue 144329 Closes rust-lang#144329.
…r=jdonszelmann error on empty `export_name` fixes rust-lang#155495 Using an empty string as the name makes LLVM make up a name. However this name can be inconsistent between compilation units, which is UB and can cause linking errors, and some parts of LLVM just crash on the empty name (see the linked issue). As far as we know there is only one valid pattern that could use this, a `#[used]` static that is not referenced by the program at all. That is not UB, but the `export_name` is not required for that to work, just normal rust name mangling would do fine. Technically this is a breaking change, but it seems unlikely that this actually breaks code in the wild that wasn't already broken. I'll leave it up to T-lang to determine what is required here (crater run, FCW, ...), but my gut feeling is that we could just merge this and nobody would notice.
…=mejrs validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters fixes rust-lang#155776 fixes rust-lang#155484 specifically, do not allow NULL bytes and the empty string in `#[link_name = "..."]` and `#[link(name = "...")]`. Like some of the others I think this formally needs to be looked at by T-lang because these errors would not show up if not linking. The LLVM erorr on `#[linke_name = "\0"]` is emitted here, it is not e.g. target-specific. https://github.com/llvm/llvm-project/blob/d593279c0b2891f0b0c8af3f70a1a0383b4ad1b5/llvm/lib/IR/Value.cpp#L336-L342 On `#[link(name = "")]` we already error today. A NULL byte in `#[link(name = "\0")]` is caught by the linker (https://godbolt.org/z/vnz9sYbPs), using `#[link_name = ""]` makes LLVM generate a name (https://godbolt.org/z/1hWEo4cxf) which is not useful and likely to cause linker errors. r? jdonszelmann
…acrum remove turbofish notation + use None / Some instead of Option:: (in match documentation)
…r=Mark-Simulacrum mark some panicking methods around Duration as track_caller Currently when they panic it looks like this ``` 0.005045 ---- instant_checked_duration_since_nopanic stdout ---- 0.000039 0.000009 thread 'instant_checked_duration_since_nopanic' (2) panicked at /home/runner/work/miri-test-libstd/miri-test-libstd/rust-src-patched/library/std/src/time.rs:445:33: 0.000007 overflow when subtracting duration from instant 0.000006 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 0.000007 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect ``` That's pretty useless. Also fix the panic message while we are at it.
…literal, r=JonathanBrouwer `rustc_attr_parsing`: add `AcceptContext::expect_string_literal`
Member
Author
|
@bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 10, 2026
Rollup of 11 pull requests Successful merges: - #149362 (Add Command::get_resolved_envs) - #155705 (Add `str::word_to_titlecase()` to `alloc`) - #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.) - #156006 (Update a bunch of bootstrap dependencies to remove windows-target) - #156169 (Change `SwitchInt` handling in dataflow analysis.) - #155188 (Add regression test for issue 144329) - #155515 (error on empty `export_name`) - #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters) - #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation)) - #156133 (mark some panicking methods around Duration as track_caller) - #156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 488aaf6 failed: CI. Failed job:
|
Member
Author
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 10, 2026
Rollup of 11 pull requests Successful merges: - #149362 (Add Command::get_resolved_envs) - #155705 (Add `str::word_to_titlecase()` to `alloc`) - #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.) - #156006 (Update a bunch of bootstrap dependencies to remove windows-target) - #156169 (Change `SwitchInt` handling in dataflow analysis.) - #155188 (Add regression test for issue 144329) - #155515 (error on empty `export_name`) - #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters) - #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation)) - #156133 (mark some panicking methods around Duration as track_caller) - #156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 16efdfa failed: CI. Failed job:
|
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.
Successful merges:
str::word_to_titlecase()toalloc#155705 (Addstr::word_to_titlecase()toalloc)SwitchInthandling in dataflow analysis. #156169 (ChangeSwitchInthandling in dataflow analysis.)export_name#155515 (error on emptyexport_name)#[link_name = "..."]&#[link(name = "...")]parameters #155817 (validate#[link_name = "..."]&#[link(name = "...")]parameters)rustc_attr_parsing: addAcceptContext::expect_string_literal#156363 (rustc_attr_parsing: addAcceptContext::expect_string_literal)r? @ghost
Create a similar rollup