Skip to content

Commit 6b96827

Browse files
committed
Remove dead code
1 parent 4dfb91d commit 6b96827

File tree

8 files changed

+0
-42
lines changed

8 files changed

+0
-42
lines changed

src/librustc_driver/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#![feature(rustc_diagnostic_macros)]
2626
#![feature(slice_sort_by_cached_key)]
2727
#![feature(set_stdio)]
28-
#![feature(rustc_stack_internals)]
2928
#![feature(no_debug)]
3029

3130
#![recursion_limit="256"]

src/libstd/rt.rs

-15
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,3 @@ fn lang_start<T: ::process::Termination + 'static>
7373
{
7474
lang_start_internal(&move || main().report(), argc, argv)
7575
}
76-
77-
/// Function used for reverting changes to the main stack before setrlimit().
78-
/// This is POSIX (non-Linux) specific and unlikely to be directly stabilized.
79-
#[unstable(feature = "rustc_stack_internals", issue = "0")]
80-
pub unsafe fn deinit_stack_guard() {
81-
::sys::thread::guard::deinit();
82-
}
83-
84-
/// Function used for resetting the main stack guard address after setrlimit().
85-
/// This is POSIX specific and unlikely to be directly stabilized.
86-
#[unstable(feature = "rustc_stack_internals", issue = "0")]
87-
pub unsafe fn update_stack_guard() {
88-
let main_guard = ::sys::thread::guard::init();
89-
::sys_common::thread_info::reset_guard(main_guard);
90-
}

src/libstd/sys/cloudabi/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ pub mod guard {
119119
pub unsafe fn init() -> Option<Guard> {
120120
None
121121
}
122-
pub unsafe fn deinit() {}
123122
}
124123

125124
fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {

src/libstd/sys/redox/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,4 @@ pub mod guard {
9292
pub type Guard = !;
9393
pub unsafe fn current() -> Option<Guard> { None }
9494
pub unsafe fn init() -> Option<Guard> { None }
95-
pub unsafe fn deinit() {}
9695
}

src/libstd/sys/sgx/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,4 @@ pub mod guard {
9797
pub type Guard = !;
9898
pub unsafe fn current() -> Option<Guard> { None }
9999
pub unsafe fn init() -> Option<Guard> { None }
100-
pub unsafe fn deinit() {}
101100
}

src/libstd/sys/unix/thread.rs

-21
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ pub mod guard {
211211
pub type Guard = Range<usize>;
212212
pub unsafe fn current() -> Option<Guard> { None }
213213
pub unsafe fn init() -> Option<Guard> { None }
214-
pub unsafe fn deinit() {}
215214
}
216215

217216

@@ -355,26 +354,6 @@ pub mod guard {
355354
}
356355
}
357356

358-
pub unsafe fn deinit() {
359-
if !cfg!(target_os = "linux") {
360-
if let Some(stackaddr) = get_stack_start_aligned() {
361-
// Remove the protection on the guard page.
362-
// FIXME: we cannot unmap the page, because when we mmap()
363-
// above it may be already mapped by the OS, which we can't
364-
// detect from mmap()'s return value. If we unmap this page,
365-
// it will lead to failure growing stack size on platforms like
366-
// macOS. Instead, just restore the page to a writable state.
367-
// This ain't Linux, so we probably don't need to care about
368-
// execstack.
369-
let result = mprotect(stackaddr, PAGE_SIZE, PROT_READ | PROT_WRITE);
370-
371-
if result != 0 {
372-
panic!("unable to reset the guard page");
373-
}
374-
}
375-
}
376-
}
377-
378357
#[cfg(any(target_os = "macos",
379358
target_os = "bitrig",
380359
target_os = "openbsd",

src/libstd/sys/wasm/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ pub mod guard {
6868
pub type Guard = !;
6969
pub unsafe fn current() -> Option<Guard> { None }
7070
pub unsafe fn init() -> Option<Guard> { None }
71-
pub unsafe fn deinit() {}
7271
}
7372

7473
cfg_if! {

src/libstd/sys/windows/thread.rs

-1
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,4 @@ pub mod guard {
9898
pub type Guard = !;
9999
pub unsafe fn current() -> Option<Guard> { None }
100100
pub unsafe fn init() -> Option<Guard> { None }
101-
pub unsafe fn deinit() {}
102101
}

0 commit comments

Comments
 (0)