Skip to content
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

Document std limitations before/after main #115247

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Aug 26, 2023

Solves #110708

@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 26, 2023
//!
//! Non-exhaustive list of known limitations:
//!
//! - after-main use of thread-locals, which also affects additional features:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not just after main that these can cause issues, they may panic during TLS destruction when any thread is exiting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but this section (and the filed issue it is trying to address) is about before/after main, not about non-main-thread lifecycles.

We could generalize it to "outside std-managed lifecycle scopes" or some similar mouthful?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just think this one sentence could be generalized to apply to TLS destruction in general, not just when exiting the main thread.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Amanieu's comment that there is room to be more informative about non-main-thread limitations too, but let's land this since it does address #110708 already, and take further details in followup PRs.

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Sep 16, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 16, 2023

📌 Commit b96db22 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2023
@dtolnay dtolnay assigned dtolnay and unassigned joshtriplett Sep 16, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#115247 (Document std limitations before/after main)
 - rust-lang#115329 (fix std::primitive doc: homogenous -> homogeneous)
 - rust-lang#115487 (Improve documentation on when signes are printed by default)
 - rust-lang#115560 (Update doc for `alloc::format!` and `core::concat!`)
 - rust-lang#115836 (update rust_analyzer_settings.json)
 - rust-lang#115884 (make ty::Const debug printing less verbose)
 - rust-lang#115890 (Migrate GUI colors test to original CSS color format)
 - rust-lang#115895 (Improve Vec(Deque)::truncate documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cf9ce96 into rust-lang:master Sep 16, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 16, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2023
Rollup merge of rust-lang#115247 - the8472:life-before-main, r=dtolnay

Document std limitations before/after main

Solves rust-lang#110708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider documenting that (parts of?) stdlib must not be used before/after main
6 participants