From eb5cd476ba7e71e22b0a856c1e78a3af1b7bbe0a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 20 Dec 2024 04:28:08 -0800 Subject: [PATCH 1/2] Drop #[lang = "eh_personality"] from no-std test --- test_suite/no_std/Cargo.toml | 6 ++++++ test_suite/no_std/src/main.rs | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test_suite/no_std/Cargo.toml b/test_suite/no_std/Cargo.toml index 5bf7eb2d1..9c8f6aa54 100644 --- a/test_suite/no_std/Cargo.toml +++ b/test_suite/no_std/Cargo.toml @@ -10,4 +10,10 @@ libc = { version = "0.2", default-features = false } serde = { path = "../../serde", default-features = false } serde_derive = { path = "../../serde_derive" } +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + [workspace] diff --git a/test_suite/no_std/src/main.rs b/test_suite/no_std/src/main.rs index e53389229..71d553e10 100644 --- a/test_suite/no_std/src/main.rs +++ b/test_suite/no_std/src/main.rs @@ -1,5 +1,3 @@ -#![allow(internal_features)] -#![feature(lang_items)] #![no_std] #![no_main] @@ -10,10 +8,6 @@ extern "C" fn main(_argc: c_int, _argv: *const *const u8) -> c_int { 0 } -#[lang = "eh_personality"] -#[no_mangle] -pub extern "C" fn rust_eh_personality() {} - #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { unsafe { From b9f93f99aaa90760d421b60b8de6273999ca8980 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 20 Dec 2024 04:30:14 -0800 Subject: [PATCH 2/2] Add no-std CI on stable compiler --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd383e901..50139b6d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: toolchain: ${{matrix.rust}} - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features + - run: cd test_suite/no_std && cargo build nightly: name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}