1
Fork 0

Change name of lang_start_real to lang_start_internal

Also remove `'static` from `__rust_begin_short_backtrace`
This commit is contained in:
Bastian Köcher 2017-12-24 00:35:38 +01:00
parent 7dfec34a20
commit 81e375dba5
2 changed files with 4 additions and 5 deletions

View file

@ -29,9 +29,8 @@ pub use panicking::{begin_panic, begin_panic_fmt, update_panic_count};
// To reduce the generated code of the new `lang_start`, this function is doing // To reduce the generated code of the new `lang_start`, this function is doing
// the real work. // the real work.
#[cfg(not(any(test, stage0)))] #[cfg(not(any(test, stage0)))]
fn lang_start_real<F>(main: F, argc: isize, argv: *const *const u8) -> ! fn lang_start_internal(main: &(Fn() -> i32 + Sync + ::panic::RefUnwindSafe),
where F: FnOnce() -> i32 + Send + ::panic::UnwindSafe + 'static argc: isize, argv: *const *const u8) -> ! {
{
use panic; use panic;
use sys; use sys;
use sys_common; use sys_common;
@ -75,7 +74,7 @@ fn lang_start_real<F>(main: F, argc: isize, argv: *const *const u8) -> !
fn lang_start<T: ::termination::Termination + 'static> fn lang_start<T: ::termination::Termination + 'static>
(main: fn() -> T, argc: isize, argv: *const *const u8) -> ! (main: fn() -> T, argc: isize, argv: *const *const u8) -> !
{ {
lang_start_real(move || main().report(), argc, argv) lang_start_internal(&move || main().report(), argc, argv)
} }
#[cfg(all(not(test), stage0))] #[cfg(all(not(test), stage0))]

View file

@ -128,7 +128,7 @@ fn filter_frames(frames: &[Frame],
/// Fixed frame used to clean the backtrace with `RUST_BACKTRACE=1`. /// Fixed frame used to clean the backtrace with `RUST_BACKTRACE=1`.
#[inline(never)] #[inline(never)]
pub fn __rust_begin_short_backtrace<F, T>(f: F) -> T pub fn __rust_begin_short_backtrace<F, T>(f: F) -> T
where F: FnOnce() -> T, F: Send + 'static, T: Send + 'static where F: FnOnce() -> T, F: Send, T: Send
{ {
f() f()
} }