From bbd4cb97542b3f26cbeb13aa8d03acbef41e4dab Mon Sep 17 00:00:00 2001 From: Youjie Zheng Date: Sat, 25 Jan 2025 10:33:43 +0800 Subject: [PATCH] [chore] Upgrade to edition2024, bump to v0.2.0 --- Cargo.toml | 4 ++-- ctor_bare/Cargo.toml | 2 +- ctor_bare/src/lib.rs | 4 ++-- ctor_bare_macros/Cargo.toml | 2 +- ctor_bare_macros/src/lib.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 83a17f3..c382220 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,8 @@ members = [ ] [workspace.package] -version = "0.1.1" +version = "0.2.0" +edition = "2024" authors = ["Youjie Zheng "] license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0" homepage = "https://github.com/arceos-org/arceos" @@ -15,4 +16,3 @@ documentation = "https://arceos-org.github.io/ctor_bare" repository = "https://github.com/arceos-org/ctor_bare" keywords = ["arceos", "constructor", "no_std"] categories = ["development-tools::procedural-macro-helpers", "no-std"] - diff --git a/ctor_bare/Cargo.toml b/ctor_bare/Cargo.toml index 6901648..c8cc2ea 100644 --- a/ctor_bare/Cargo.toml +++ b/ctor_bare/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctor_bare" -edition = "2021" +edition.workspace = true description = "Register constructor functions for Rust at complie time under no_std." documentation = "https://docs.rs/ctor_bare" version.workspace = true diff --git a/ctor_bare/src/lib.rs b/ctor_bare/src/lib.rs index 94cc257..a357c01 100644 --- a/ctor_bare/src/lib.rs +++ b/ctor_bare/src/lib.rs @@ -5,11 +5,11 @@ pub use ctor_bare_macros::register_ctor; /// Placeholder for the `.init_array` section, so that /// the `__init_array_start` and `__init_array_end` symbols can be generated. -#[link_section = ".init_array"] +#[unsafe(link_section = ".init_array")] #[used] static _SECTION_PLACE_HOLDER: [u8; 0] = []; -extern "C" { +unsafe extern "C" { fn __init_array_start(); fn __init_array_end(); } diff --git a/ctor_bare_macros/Cargo.toml b/ctor_bare_macros/Cargo.toml index ee85059..5878aeb 100644 --- a/ctor_bare_macros/Cargo.toml +++ b/ctor_bare_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctor_bare_macros" -edition = "2021" +edition.workspace = true description = "Macros for registering constructor functions for Rust under no_std." documentation = "https://docs.rs/ctor_bare_macros" version.workspace = true diff --git a/ctor_bare_macros/src/lib.rs b/ctor_bare_macros/src/lib.rs index ac6732d..afdd8b0 100644 --- a/ctor_bare_macros/src/lib.rs +++ b/ctor_bare_macros/src/lib.rs @@ -11,7 +11,7 @@ use proc_macro::TokenStream; use proc_macro2::Span; use quote::{format_ident, quote}; -use syn::{parse_macro_input, Error, Item}; +use syn::{Error, Item, parse_macro_input}; /// Register a constructor function to be called before `main`. ///