Skip to content

std: Internalize almost all of std::rt #28306

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

Merged
merged 1 commit into from
Sep 11, 2015
Merged

Conversation

alexcrichton
Copy link
Member

This commit does some refactoring to make almost all of the std::rt private.
Specifically, the following items are no longer part of its API:

  • DEFAULT_ERROR_CODE
  • backtrace
  • unwind
  • args
  • at_exit
  • cleanup
  • heap (this is just alloc::heap)
  • min_stack
  • util

The module is now tagged as #[doc(hidden)] as the only purpose it's serve is
an entry point for the panic! macro via the begin_unwind and
begin_unwind_fmt reexports.

@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive rust-highfive assigned huonw and brson and unassigned huonw Sep 8, 2015
@rust-highfive
Copy link
Contributor

r? @huonw

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

@@ -442,19 +440,6 @@ fn init() {

assert!(DIRECTIVES.is_null());
DIRECTIVES = Box::into_raw(box directives);

// Schedule the cleanup for the globals for when the runtime exits.
Copy link
Contributor

Choose a reason for hiding this comment

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

If this block is to be removed, should we also delete https://github.com/alexcrichton/rust/blob/less-rt/src/liblog/lib.rs#L293 and https://github.com/alexcrichton/rust/blob/less-rt/src/liblog/lib.rs#L386 ?
AFAICT 1 will never be assigned to them in the new code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, those pieces can be deleted

@arielb1
Copy link
Contributor

arielb1 commented Sep 9, 2015

Is the privatization of backtrace::write intentional? That function is really important for anyone that wants to write their own panic handler.

The function is also platform-dependent so you can't really work around its absence with copy-paste or creative use of transmute.

@brson
Copy link
Contributor

brson commented Sep 9, 2015

r=me assuming @arielb1's q's are satisfied

@alexcrichton
Copy link
Member Author

@arielb1 it is intentional, yes. This module was never intended to be public and it's just a historical relic that it's still exposed, so I wanted to hide it via privacy ASAP. Currently there's no stable method to write your own panic handler, so it's not a critical use case for continued exposure. External crates can use support on crates.io and this can be re-exposed temporarily for internal crates if truly necessary.

@bors: r=brson 53f933b661c9206d29a2414d58a2f106aed0db9b

@bors
Copy link
Collaborator

bors commented Sep 10, 2015

🙀 53f933b661c9206d29a2414d58a2f106aed0db9b is not a valid commit SHA. Please try again with f58cd68.

@alexcrichton
Copy link
Member Author

@bors: r=brson f58cd68a9af504f92f30084a30c31f2f8554b011

@bors
Copy link
Collaborator

bors commented Sep 10, 2015

⌛ Testing commit f58cd68 with merge 4dff74d...

@bors
Copy link
Collaborator

bors commented Sep 10, 2015

💔 Test failed - auto-win-msvc-64-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson c57b604856994eb0bbd2bdb02e86618c4392be0d

@bors
Copy link
Collaborator

bors commented Sep 10, 2015

⌛ Testing commit c57b604 with merge 1759de6...

@bors
Copy link
Collaborator

bors commented Sep 10, 2015

💔 Test failed - auto-win-msvc-64-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson 01991321f7384fc40928faf0ce69e355a24ec5df

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

⌛ Testing commit 0199132 with merge 0e8e8d0...

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member Author

@bors: r+ ffe18b39f332434e01a383921b60cb213b484cb9

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

⌛ Testing commit ffe18b3 with merge 49d0622...

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

💔 Test failed - auto-win-msvc-32-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson 13b228c42a35e992e04d6f47d5c3d15055449606

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

⌛ Testing commit 13b228c with merge a762b4d...

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

💔 Test failed - auto-linux-64-x-android-t

This commit does some refactoring to make almost all of the `std::rt` private.
Specifically, the following items are no longer part of its API:

* DEFAULT_ERROR_CODE
* backtrace
* unwind
* args
* at_exit
* cleanup
* heap (this is just alloc::heap)
* min_stack
* util

The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is
an entry point for the `panic!` macro via the `begin_unwind` and
`begin_unwind_fmt` reexports.
@alexcrichton
Copy link
Member Author

@bors: r=brson f4be202

@bors
Copy link
Collaborator

bors commented Sep 11, 2015

⌛ Testing commit f4be202 with merge c8ded9a...

bors added a commit that referenced this pull request Sep 11, 2015
This commit does some refactoring to make almost all of the `std::rt` private.
Specifically, the following items are no longer part of its API:

* DEFAULT_ERROR_CODE
* backtrace
* unwind
* args
* at_exit
* cleanup
* heap (this is just alloc::heap)
* min_stack
* util

The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is
an entry point for the `panic!` macro via the `begin_unwind` and
`begin_unwind_fmt` reexports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants