Skip to content

Rollup of 8 pull requests #33959

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 19 commits into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
abe9961
* Fix compile_fail tag (in some cases, it compiled whereas it wasn't …
GuillaumeGomez May 22, 2016
a850d40
Improve E0132 error explanation
GuillaumeGomez May 27, 2016
a1e240c
Improve E0137 error explanatIon
GuillaumeGomez May 27, 2016
360d723
Improve E0138 error explanation
GuillaumeGomez May 27, 2016
c848ca1
Improve E0133 error explanation
GuillaumeGomez May 27, 2016
4fa8483
improve E0152 error explanation
GuillaumeGomez May 27, 2016
3fd0e4c
rustfmt liballoc folder
srinivasreddy May 27, 2016
feb0b27
Added examples/docs to split in str.rs
Ophirr33 May 26, 2016
72baa41
run rustfmt on librand folder
srinivasreddy May 29, 2016
5ed45ef
run rustfmt on libunwind
srinivasreddy May 29, 2016
31b9060
Improve E0161 error explanation
GuillaumeGomez May 27, 2016
10e1e6a
Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomez
Manishearth May 30, 2016
400b9b3
Rollup merge of #33893 - Ophirr33:docs_string_split_fix, r=GuillaumeG…
Manishearth May 30, 2016
11549f0
Rollup merge of #33912 - GuillaumeGomez:improve_E0132, r=steveklabnik
Manishearth May 30, 2016
6c6dcc9
Rollup merge of #33913 - GuillaumeGomez:improve_e0133, r=GuillaumeGomez
Manishearth May 30, 2016
c41e9d9
Rollup merge of #33914 - GuillaumeGomez:improve_err_expl, r=Guillaume…
Manishearth May 30, 2016
0072e6b
Rollup merge of #33917 - srinivasreddy:rustfmt_liballoc, r=GuillaumeG…
Manishearth May 30, 2016
21dc6c2
Rollup merge of #33937 - srinivasreddy:rustfmt_librand, r=GuillaumeGomez
Manishearth May 30, 2016
9d2ec40
Rollup merge of #33938 - srinivasreddy:rustfmt_libunwind, r=Manishearth
Manishearth May 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/libunwind/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ extern crate libc;
mod libunwind;
#[cfg(not(target_env = "msvc"))]
pub use libunwind::*;

47 changes: 20 additions & 27 deletions src/libunwind/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub enum _Unwind_State {
_US_UNWIND_FRAME_RESUME = 2,
_US_ACTION_MASK = 3,
_US_FORCE_UNWIND = 8,
_US_END_OF_STACK = 16
_US_END_OF_STACK = 16,
}

#[repr(C)]
Expand All @@ -59,9 +59,8 @@ pub type _Unwind_Exception_Class = u64;

pub type _Unwind_Word = libc::uintptr_t;

pub type _Unwind_Trace_Fn =
extern fn(ctx: *mut _Unwind_Context,
arg: *mut libc::c_void) -> _Unwind_Reason_Code;
pub type _Unwind_Trace_Fn = extern "C" fn(ctx: *mut _Unwind_Context, arg: *mut libc::c_void)
-> _Unwind_Reason_Code;

#[cfg(target_arch = "x86")]
pub const unwinder_private_data_size: usize = 5;
Expand Down Expand Up @@ -97,9 +96,8 @@ pub struct _Unwind_Exception {

pub enum _Unwind_Context {}

pub type _Unwind_Exception_Cleanup_Fn =
extern "C" fn(unwind_code: _Unwind_Reason_Code,
exception: *mut _Unwind_Exception);
pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn(unwind_code: _Unwind_Reason_Code,
exception: *mut _Unwind_Exception);

#[cfg_attr(any(all(target_os = "linux", not(target_env = "musl")),
target_os = "freebsd",
Expand Down Expand Up @@ -127,20 +125,18 @@ pub type _Unwind_Exception_Cleanup_Fn =
#[cfg_attr(all(target_os = "windows", target_env = "gnu"),
link(name = "gcc_eh"))]
#[cfg(not(cargobuild))]
extern {}
extern "C" {}

extern {
extern "C" {
// iOS on armv7 uses SjLj exceptions and requires to link
// against corresponding routine (..._SjLj_...)
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
#[unwind]
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception)
-> _Unwind_Reason_Code;
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code;

#[cfg(all(target_os = "ios", target_arch = "arm"))]
#[unwind]
fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception)
-> _Unwind_Reason_Code;
fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;

pub fn _Unwind_DeleteException(exception: *mut _Unwind_Exception);

Expand All @@ -151,28 +147,26 @@ extern {
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
trace_argument: *mut libc::c_void)
-> _Unwind_Reason_Code;
-> _Unwind_Reason_Code;

// available since GCC 4.2.0, should be fine for our purpose
#[cfg(all(not(all(target_os = "android", target_arch = "arm")),
not(all(target_os = "linux", target_arch = "arm"))))]
pub fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context,
ip_before_insn: *mut libc::c_int)
-> libc::uintptr_t;
-> libc::uintptr_t;

#[cfg(all(not(target_os = "android"),
not(all(target_os = "linux", target_arch = "arm"))))]
pub fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void)
-> *mut libc::c_void;
pub fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void) -> *mut libc::c_void;
}

// ... and now we just providing access to SjLj counterspart
// through a standard name to hide those details from others
// (see also comment above regarding _Unwind_RaiseException)
#[cfg(all(target_os = "ios", target_arch = "arm"))]
#[inline]
pub unsafe fn _Unwind_RaiseException(exc: *mut _Unwind_Exception)
-> _Unwind_Reason_Code {
pub unsafe fn _Unwind_RaiseException(exc: *mut _Unwind_Exception) -> _Unwind_Reason_Code {
_Unwind_SjLj_RaiseException(exc)
}

Expand Down Expand Up @@ -207,18 +201,20 @@ pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
}

type _Unwind_Word = libc::c_uint;
extern {
extern "C" {
fn _Unwind_VRS_Get(ctx: *mut _Unwind_Context,
klass: _Unwind_VRS_RegClass,
word: _Unwind_Word,
repr: _Unwind_VRS_DataRepresentation,
data: *mut libc::c_void)
-> _Unwind_VRS_Result;
-> _Unwind_VRS_Result;
}

let mut val: _Unwind_Word = 0;
let ptr = &mut val as *mut _Unwind_Word;
let _ = _Unwind_VRS_Get(ctx, _Unwind_VRS_RegClass::_UVRSC_CORE, 15,
let _ = _Unwind_VRS_Get(ctx,
_Unwind_VRS_RegClass::_UVRSC_CORE,
15,
_Unwind_VRS_DataRepresentation::_UVRSD_UINT32,
ptr as *mut libc::c_void);
(val & !1) as libc::uintptr_t
Expand All @@ -230,8 +226,7 @@ pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
all(target_os = "linux", target_arch = "arm")))]
pub unsafe fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context,
ip_before_insn: *mut libc::c_int)
-> libc::uintptr_t
{
-> libc::uintptr_t {
*ip_before_insn = 0;
_Unwind_GetIP(ctx)
}
Expand All @@ -240,8 +235,6 @@ pub unsafe fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context,
// a no-op
#[cfg(any(target_os = "android",
all(target_os = "linux", target_arch = "arm")))]
pub unsafe fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void)
-> *mut libc::c_void
{
pub unsafe fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void) -> *mut libc::c_void {
pc
}