mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 22:58:02 +00:00
891ced598a
error: the feature `lang_items` is internal to the compiler or standard library
--> src/main.rs:1:12
|
1 | #![feature(lang_items, start)]
| ^^^^^^^^^^
|
= note: using it is strongly discouraged
= note: `#[deny(internal_features)]` on by default
46 lines
808 B
Rust
46 lines
808 B
Rust
#![allow(internal_features)]
|
|
#![feature(lang_items, start)]
|
|
#![no_std]
|
|
|
|
#[start]
|
|
fn start(_argc: isize, _argv: *const *const u8) -> isize {
|
|
0
|
|
}
|
|
|
|
#[lang = "eh_personality"]
|
|
#[no_mangle]
|
|
pub extern "C" fn rust_eh_personality() {}
|
|
|
|
#[panic_handler]
|
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
|
unsafe {
|
|
libc::abort();
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
use serde_derive::{Deserialize, Serialize};
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
struct Unit;
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
struct Newtype(u8);
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
struct Tuple(u8, u8);
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
struct Struct {
|
|
f: u8,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
enum Enum {
|
|
Unit,
|
|
Newtype(u8),
|
|
Tuple(u8, u8),
|
|
Struct { f: u8 },
|
|
}
|