Skip to content

Commit f2fe12a

Browse files
committed
libpanic_unwind => 2018
1 parent e544947 commit f2fe12a

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

src/libpanic_unwind/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "panic_unwind"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
path = "lib.rs"

src/libpanic_unwind/dwarf/eh.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![allow(non_upper_case_globals)]
1212
#![allow(unused)]
1313

14-
use dwarf::DwarfReader;
14+
use crate::dwarf::DwarfReader;
1515
use core::mem;
1616

1717
pub const DW_EH_PE_omit: u8 = 0xFF;
@@ -51,7 +51,7 @@ pub enum EHAction {
5151

5252
pub const USING_SJLJ_EXCEPTIONS: bool = cfg!(all(target_os = "ios", target_arch = "arm"));
5353

54-
pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext)
54+
pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>)
5555
-> Result<EHAction, ()>
5656
{
5757
if lsda.is_null() {
@@ -145,7 +145,7 @@ fn round_up(unrounded: usize, align: usize) -> Result<usize, ()> {
145145
}
146146

147147
unsafe fn read_encoded_pointer(reader: &mut DwarfReader,
148-
context: &EHContext,
148+
context: &EHContext<'_>,
149149
encoding: u8)
150150
-> Result<usize, ()> {
151151
if encoding == DW_EH_PE_omit {

src/libpanic_unwind/emcc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
use core::any::Any;
1212
use core::ptr;
13+
use core::mem;
1314
use alloc::boxed::Box;
1415
use libc::{self, c_int};
1516
use unwind as uw;
16-
use core::mem;
1717

1818
pub fn payload() -> *mut u8 {
1919
ptr::null_mut()

src/libpanic_unwind/gcc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use alloc::boxed::Box;
5252

5353
use unwind as uw;
5454
use libc::{c_int, uintptr_t};
55-
use dwarf::eh::{self, EHContext, EHAction};
55+
use crate::dwarf::eh::{self, EHContext, EHAction};
5656

5757
#[repr(C)]
5858
struct Exception {

src/libpanic_unwind/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1818
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
1919

20+
#![deny(rust_2018_idioms)]
21+
2022
#![feature(allocator_api)]
2123
#![feature(alloc)]
2224
#![feature(core_intrinsics)]
@@ -32,8 +34,6 @@
3234
#![panic_runtime]
3335
#![feature(panic_runtime)]
3436

35-
extern crate alloc;
36-
extern crate libc;
3737
#[cfg(not(any(target_env = "msvc", all(windows, target_arch = "x86_64", target_env = "gnu"))))]
3838
extern crate unwind;
3939

@@ -87,7 +87,7 @@ pub unsafe extern "C" fn __rust_maybe_catch_panic(f: fn(*mut u8),
8787
vtable_ptr: *mut usize)
8888
-> u32 {
8989
let mut payload = imp::payload();
90-
if intrinsics::try(f, data, &mut payload as *mut _ as *mut _) == 0 {
90+
if intrinsics::r#try(f, data, &mut payload as *mut _ as *mut _) == 0 {
9191
0
9292
} else {
9393
let obj = mem::transmute::<_, raw::TraitObject>(imp::cleanup(payload));

src/libpanic_unwind/seh.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use core::any::Any;
5252
use core::mem;
5353
use core::raw;
5454

55-
use windows as c;
55+
use crate::windows as c;
5656
use libc::{c_int, c_uint};
5757

5858
// First up, a whole bunch of type definitions. There's a few platform-specific
@@ -301,5 +301,5 @@ pub unsafe fn cleanup(payload: [u64; 2]) -> Box<dyn Any + Send> {
301301
#[lang = "eh_personality"]
302302
#[cfg(not(test))]
303303
fn rust_eh_personality() {
304-
unsafe { ::core::intrinsics::abort() }
304+
unsafe { core::intrinsics::abort() }
305305
}

src/libpanic_unwind/seh64_gnu.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use alloc::boxed::Box;
99
use core::any::Any;
1010
use core::intrinsics;
1111
use core::ptr;
12-
use dwarf::eh::{EHContext, EHAction, find_eh_action};
13-
use windows as c;
12+
use crate::dwarf::eh::{EHContext, EHAction, find_eh_action};
13+
use crate::windows as c;
1414

1515
// Define our exception codes:
1616
// according to http://msdn.microsoft.com/en-us/library/het71c37(v=VS.80).aspx,

0 commit comments

Comments
 (0)