Rfc 2070 panic implementation deprecated (#467)

* Make changes to code examples.

* Explain that panic_implementation has been deprecated

* Update attributes in source code.
This commit is contained in:
Ben
2018-10-01 16:38:48 +08:00
committed by Philipp Oppermann
parent 0bd4fcd99e
commit 2a9075d642
10 changed files with 21 additions and 33 deletions

View File

@@ -1,4 +1,3 @@
#![feature(panic_implementation)] // required for defining the panic handler
#![no_std] // don't link the Rust standard library
#![cfg_attr(not(test), no_main)] // disable all Rust-level entry points
#![cfg_attr(test, allow(dead_code, unused_macros, unused_imports))]
@@ -25,7 +24,7 @@ pub extern "C" fn _start() -> ! {
/// This function is called on panic.
#[cfg(not(test))]
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
serial_println!("failed");

View File

@@ -1,4 +1,3 @@
#![feature(panic_implementation)]
#![feature(abi_x86_interrupt)]
#![no_std]
#![cfg_attr(not(test), no_main)]
@@ -45,7 +44,7 @@ pub extern "C" fn _start() -> ! {
/// This function is called on panic.
#[cfg(not(test))]
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
serial_println!("failed");

View File

@@ -1,4 +1,3 @@
#![feature(panic_implementation)]
#![feature(abi_x86_interrupt)]
#![no_std]
#![cfg_attr(not(test), no_main)]
@@ -39,7 +38,7 @@ pub extern "C" fn _start() -> ! {
/// This function is called on panic.
#[cfg(not(test))]
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
serial_println!("failed");

View File

@@ -1,4 +1,3 @@
#![feature(panic_implementation)]
#![no_std]
#![cfg_attr(not(test), no_main)]
#![cfg_attr(test, allow(dead_code, unused_macros, unused_imports))]
@@ -16,7 +15,7 @@ pub extern "C" fn _start() -> ! {
}
#[cfg(not(test))]
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub fn panic(_info: &PanicInfo) -> ! {
serial_println!("ok");

View File

@@ -1,4 +1,3 @@
#![feature(panic_implementation)] // required for defining the panic handler
#![feature(abi_x86_interrupt)]
#![no_std] // don't link the Rust standard library
#![cfg_attr(not(test), no_main)] // disable all Rust-level entry points
@@ -35,7 +34,7 @@ pub extern "C" fn _start() -> ! {
/// This function is called on panic.
#[cfg(not(test))]
#[panic_implementation]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
println!("{}", info);