<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/rt.rs, branch 1.89.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.89.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.89.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-05-15T09:20:13+00:00</updated>
<entry>
<title>deduplicate abort implementations</title>
<updated>2025-05-15T09:20:13+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-03-29T11:16:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b7f2cd3a2b1606934018cc64bac52bb887ea892a'/>
<id>urn:sha1:b7f2cd3a2b1606934018cc64bac52bb887ea892a</id>
<content type='text'>
Currently, the code for process aborts is duplicated across `panic_abort` and `std`. This PR uses `#[rustc_std_internal_symbol]` to make the `std` implementation available to `panic_abort` via the linker, thereby deduplicating the code.
</content>
</entry>
<entry>
<title>rtprintpanic: clarify that the error is aborting the process</title>
<updated>2025-04-18T13:02:22+00:00</updated>
<author>
<name>Lieselotte</name>
<email>52315535+she3py@users.noreply.github.com</email>
</author>
<published>2025-04-18T13:02:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=17b7d63fd787699dac3fffbf9930dc799291a5f2'/>
<id>urn:sha1:17b7d63fd787699dac3fffbf9930dc799291a5f2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #135446 - klensy:panic_immediate_abort_ext, r=Mark-Simulacrum</title>
<updated>2025-01-20T04:38:32+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>39484203+jieyouxu@users.noreply.github.com</email>
</author>
<published>2025-01-20T04:38:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e5b85035fefb37b5f314ca0f07a5560de6ed0a0c'/>
<id>urn:sha1:e5b85035fefb37b5f314ca0f07a5560de6ed0a0c</id>
<content type='text'>
further improve panic_immediate_abort by removing rtprintpanic! messages

Reduces binary size using `panic_immediate_abort` by removing strings used by `rtprintpanic!`.

for `main.rs`
```rust
fn main() {
    println!("Hello, world!");
}
```
with `Cargo.toml`
```toml
[package]
name = "tst"
version = "0.1.0"
edition = "2024"

[dependencies]

[profile.release]
lto = true
codegen-units = 1
panic = "abort"

```

and build with `RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none" cargo +stage-1 b -r -Z build-std=std,panic_abort -Z build-std-features=optimize_for_size,panic_immediate_abort` for `x86_64-unknown-linux-gnu`

This reduces size:
| before |  after | type |
| - | - | - |
| 25256 | 21880 | unstripped |
| 18072 | 15288 | stripped |
</content>
</entry>
<entry>
<title>std: lazily allocate the main thread handle</title>
<updated>2025-01-14T12:37:28+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2024-11-25T12:01:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=14f7f4b7bfcfbfe9a6f778e762cac83420e08007'/>
<id>urn:sha1:14f7f4b7bfcfbfe9a6f778e762cac83420e08007</id>
<content type='text'>
Thereby, we also allow accessing thread::current before main: as the runtime no longer tries to install its own handle, this will no longer trigger an abort. Rather, the name returned from name will only be "main" after the runtime initialization code has run, but I think that is acceptable.

This new approach also requires some changes to the signal handling code, as calling `thread::current` would now allocate when called on the main thread, which is not acceptable. I fixed this by adding a new function (`with_current_name`) that performs all the naming logic without allocation or without initializing the thread ID (which could allocate on some platforms).
</content>
</entry>
<entry>
<title>Revert "Remove the Arc rt::init allocation for thread info"</title>
<updated>2025-01-14T12:37:25+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2024-11-25T08:50:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0e5ee891b2b07321175e398153bfa86c667f3494'/>
<id>urn:sha1:0e5ee891b2b07321175e398153bfa86c667f3494</id>
<content type='text'>
This reverts commit 0747f2898e83df7e601189c0f31762e84328becb.
</content>
</entry>
<entry>
<title>further improve panic_immediate_abort by removing rtprintpanic messages</title>
<updated>2025-01-13T18:11:42+00:00</updated>
<author>
<name>klensy</name>
<email>klensy@users.noreply.github.com</email>
</author>
<published>2025-01-13T18:00:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3a0554a44578afb2f69babdae39f8880d23560ae'/>
<id>urn:sha1:3a0554a44578afb2f69babdae39f8880d23560ae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>avoid nesting the user-defined main so deeply on the stack</title>
<updated>2025-01-11T14:53:42+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-01-11T14:43:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=471d8301066815613e4c468b9fbbf7286fb4cfe6'/>
<id>urn:sha1:471d8301066815613e4c468b9fbbf7286fb4cfe6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use a single large catch_unwind in lang_start</title>
<updated>2025-01-11T14:50:53+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-01-11T09:35:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f7fe81d53b421e946c1b9ab35d43920428deb94'/>
<id>urn:sha1:9f7fe81d53b421e946c1b9ab35d43920428deb94</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove the Arc rt::init allocation for thread info</title>
<updated>2024-10-19T13:39:20+00:00</updated>
<author>
<name>GnomedDev</name>
<email>david2005thomas@gmail.com</email>
</author>
<published>2024-10-16T20:10:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0747f2898e83df7e601189c0f31762e84328becb'/>
<id>urn:sha1:0747f2898e83df7e601189c0f31762e84328becb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: fix stdout-before-main</title>
<updated>2024-10-12T11:01:36+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2024-10-12T11:01:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f91c5099fb7261cf8c85cc638d2692a317060ec'/>
<id>urn:sha1:9f91c5099fb7261cf8c85cc638d2692a317060ec</id>
<content type='text'>
Fixes #130210.

Since #124881, `ReentrantLock` uses `ThreadId` to identify threads. This has the unfortunate consequence of breaking uses of `Stdout` before main: Locking the `ReentrantLock` that synchronizes the output will initialize the thread ID before the handle for the main thread is set in `rt::init`. But since that would overwrite the current thread ID, `thread::set_current` triggers an abort.

This PR fixes the problem by using the already initialized thread ID for constructing the main thread handle and allowing `set_current` calls that do not change the thread's ID.
</content>
</entry>
</feed>
