-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for RFC 3325: unsafe attributes #123757
Comments
@rustbot assign @carbotaniuman @carbotaniuman has volunteered to own this item to get it over the line for the edition. Huge thanks for that. |
…<try> Parse unsafe attributes Initial parse implementation for rust-lang#123757 This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
@rustbot labels +I-style-nominated There's probably not a lot for T-style to do here, but strictly speaking, this is a kind of new syntax, so it may be worth at least a short discussion for visibility. |
@rustbot labels -I-style-nominated We discussed this in the style team meeting today and confirmed that this will not require any special handling or changes to the style guide. |
…r=michaelwoerister Parse unsafe attributes Initial parse implementation for rust-lang#123757 This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
…r=michaelwoerister Parse unsafe attributes Initial parse implementation for rust-lang#123757 This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
…r=michaelwoerister Parse unsafe attributes Initial parse implementation for rust-lang#123757 This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
Rollup merge of rust-lang#124214 - carbotaniuman:parse_unsafe_attrs, r=michaelwoerister Parse unsafe attributes Initial parse implementation for rust-lang#123757 This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
Edition docs are up at rust-lang/edition-guide#308. |
…r=jieyouxu Add hard error and migration lint for unsafe attrs More implementation work for rust-lang#123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
…r=jieyouxu Add hard error and migration lint for unsafe attrs More implementation work for rust-lang#123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
Rollup merge of rust-lang#126177 - carbotaniuman:unsafe_attr_errors, r=jieyouxu Add hard error and migration lint for unsafe attrs More implementation work for rust-lang#123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
…ification, r=estebank,traviscross More unsafe attr verification This code denies unsafe on attributes such as `#[test]` and `#[ignore]`, while also changing the `MetaItem` parsing so `unsafe` in args like `#[allow(unsafe(dead_code))]` is not accidentally allowed. Tracking: - rust-lang#123757
…ication, r=estebank,traviscross More unsafe attr verification This code denies unsafe on attributes such as `#[test]` and `#[ignore]`, while also changing the `MetaItem` parsing so `unsafe` in args like `#[allow(unsafe(dead_code))]` is not accidentally allowed. Tracking: - rust-lang#123757
…r=estebank,traviscross More unsafe attr verification This code denies unsafe on attributes such as `#[test]` and `#[ignore]`, while also changing the `MetaItem` parsing so `unsafe` in args like `#[allow(unsafe(dead_code))]` is not accidentally allowed. Tracking: - rust-lang/rust#123757
…r=estebank,traviscross More unsafe attr verification This code denies unsafe on attributes such as `#[test]` and `#[ignore]`, while also changing the `MetaItem` parsing so `unsafe` in args like `#[allow(unsafe(dead_code))]` is not accidentally allowed. Tracking: - rust-lang/rust#123757
…r, r=nnethercote Stabilize `unsafe_attributes` # Stabilization report ## Summary This is a tracking issue for the RFC 3325: unsafe attributes We are stabilizing `#![feature(unsafe_attributes)]`, which makes certain attributes considered 'unsafe', meaning that they must be surrounded by an `unsafe(...)`, as in `#[unsafe(no_mangle)]`. RFC: rust-lang/rfcs#3325 Tracking issue: rust-lang#123757 ## What is stabilized ### Summary of stabilization Certain attributes will now be designated as unsafe attributes, namely, `no_mangle`, `export_name`, and `link_section` (stable only), and these attributes will need to be called by surrounding them in `unsafe(...)` syntax. On editions prior to 2024, this is simply an edition lint, but it will become a hard error in 2024. This also works in `cfg_attr`, but `unsafe` is not allowed for any other attributes, including proc-macros ones. ```rust #[unsafe(no_mangle)] fn a() {} #[cfg_attr(any(), unsafe(export_name = "c"))] fn b() {} ``` For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see [this comment here](rust-lang#124214 (comment)) ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-attributes` and `tests/ui/attributes/unsafe`.
… r=nnethercote Stabilize `unsafe_attributes` # Stabilization report ## Summary This is a tracking issue for the RFC 3325: unsafe attributes We are stabilizing `#![feature(unsafe_attributes)]`, which makes certain attributes considered 'unsafe', meaning that they must be surrounded by an `unsafe(...)`, as in `#[unsafe(no_mangle)]`. RFC: rust-lang/rfcs#3325 Tracking issue: rust-lang#123757 ## What is stabilized ### Summary of stabilization Certain attributes will now be designated as unsafe attributes, namely, `no_mangle`, `export_name`, and `link_section` (stable only), and these attributes will need to be called by surrounding them in `unsafe(...)` syntax. On editions prior to 2024, this is simply an edition lint, but it will become a hard error in 2024. This also works in `cfg_attr`, but `unsafe` is not allowed for any other attributes, including proc-macros ones. ```rust #[unsafe(no_mangle)] fn a() {} #[cfg_attr(any(), unsafe(export_name = "c"))] fn b() {} ``` For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see [this comment here](rust-lang#124214 (comment)) ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-attributes` and `tests/ui/attributes/unsafe`.
@rustbot labels +S-tracking-ready-for-edition We reviewed this in the edition call today. This item is ready for Rust 2024. Thanks to @carbotaniuman for pushing forward this item. Thanks to @RalfJung for writing up the RFC. And thanks to the many reviewers. |
Let's reopen this to track documentation: somewhere around here, it should document what the safety requirements are for these attributes:
|
@RalfJung That documentation has already been updated by rust-lang/reference#1539. Can you say if that covers what you are expecting? |
I think we could add a sentence like "It may also lead to addresses being accessed with the wrong address space, for instance, on Harvard architectures" to address #76507 specifically, but I think "place data and code into sections |
Ah, fair, yes that should suffice for now. :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
… r=nnethercote Stabilize `unsafe_attributes` # Stabilization report ## Summary This is a tracking issue for the RFC 3325: unsafe attributes We are stabilizing `#![feature(unsafe_attributes)]`, which makes certain attributes considered 'unsafe', meaning that they must be surrounded by an `unsafe(...)`, as in `#[unsafe(no_mangle)]`. RFC: rust-lang/rfcs#3325 Tracking issue: rust-lang#123757 ## What is stabilized ### Summary of stabilization Certain attributes will now be designated as unsafe attributes, namely, `no_mangle`, `export_name`, and `link_section` (stable only), and these attributes will need to be called by surrounding them in `unsafe(...)` syntax. On editions prior to 2024, this is simply an edition lint, but it will become a hard error in 2024. This also works in `cfg_attr`, but `unsafe` is not allowed for any other attributes, including proc-macros ones. ```rust #[unsafe(no_mangle)] fn a() {} #[cfg_attr(any(), unsafe(export_name = "c"))] fn b() {} ``` For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see [this comment here](rust-lang#124214 (comment)) ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-attributes` and `tests/ui/attributes/unsafe`.
Turns out there's some follow-up cleanup we can do, now that we have a proper notion of "unsafe attributes": #131801 |
error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:8:1 | 8 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 11 | #[distributed_slice(SHENANIGANS)] | --------------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> note: the lint level is defined here --> tests/distributed_slice.rs:2:9 | 2 | #![deny(rust_2024_compatibility, unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[deny(unsafe_attr_outside_unsafe)]` implied by `#[deny(rust_2024_compatibility)]` = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 8 | #[unsafe(distributed_slice)] | +++++++ + error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:8:1 | 8 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 14 | #[distributed_slice(SHENANIGANS)] | --------------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 8 | #[unsafe(distributed_slice)] | +++++++ + error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:8:1 | 8 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 17 | #[distributed_slice(SHENANIGANS)] | --------------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 8 | #[unsafe(distributed_slice)] | +++++++ + error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:44:5 | 44 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 47 | #[distributed_slice(NONCOPY)] | ----------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> = note: this error originates in the macro `NONCOPY` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 44 | #[unsafe(distributed_slice)] | +++++++ + error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:55:5 | 55 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 58 | #[distributed_slice(MUTABLE)] | ----------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> = note: this error originates in the macro `MUTABLE` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 55 | #[unsafe(distributed_slice)] | +++++++ + error: unsafe attribute used without unsafe --> tests/distributed_slice.rs:67:5 | 67 | #[distributed_slice] | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute ... 70 | #[distributed_slice(MYSLICE)] | ----------------------------- in this procedural macro expansion | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <rust-lang/rust#123757> = note: this error originates in the macro `MYSLICE` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info) help: wrap the attribute in `unsafe(...)` | 67 | #[unsafe(distributed_slice)] | +++++++ +
warning: unsafe attribute used without unsafe --> tests/ffi/module.rs:15:19 | 15 | impl Vec<Job> {} | ^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> note: the lint level is defined here --> tests/ffi/lib.rs:18:9 | 18 | #![warn(rust_2024_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(unsafe_attr_outside_unsafe)]` implied by `#[warn(rust_2024_compatibility)]` help: wrap the attribute in `unsafe(...)` | 15 | impl Vec<Job> {unsafe(}) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:171:58 | 171 | fn c_take_callback(callback: fn(String) -> usize); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 171 | fn c_take_callback(callback: fn(String) -> usize)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:172:54 | 172 | fn c_take_callback_ref(callback: fn(&String)); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 172 | fn c_take_callback_ref(callback: fn(&String))unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:174:70 | 174 | fn c_take_callback_ref_lifetime<'a>(callback: fn(&'a String)); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 174 | fn c_take_callback_ref_lifetime<'a>(callback: fn(&'a String))unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:175:58 | 175 | fn c_take_callback_mut(callback: fn(&mut String)); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 175 | fn c_take_callback_mut(callback: fn(&mut String))unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:31:28 | 31 | #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 31 | #[derive(Clone, Debug, Paunsafe(rtialE)q, Eq, PartialOrd, Ord)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:31:43 | 31 | #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] | ^^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 31 | #[derive(Clone, Debug, PartialEq, Eq, Paunsafe(rtialOr)d, Ord)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:36:14 | 36 | #[derive(PartialEq, PartialOrd)] | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 36 | #[derive(Paunsafe(rtialE)q, PartialOrd)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:36:25 | 36 | #[derive(PartialEq, PartialOrd)] | ^^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 36 | #[derive(PartialEq, Paunsafe(rtialOr)d)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:82:14 | 82 | #[derive(Hash)] | ^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 82 | #[derive(Haunsafe(s)h)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:93:47 | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] | ^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Haunsafe(s)h, Ord, PartialEq, PartialOrd)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:93:58 | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, Paunsafe(rtialE)q, PartialOrd)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:93:69 | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] | ^^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 93 | #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, Paunsafe(rtialOr)d)] | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:236:14 | 236 | type Reference<'a>; | ^^^^^^^^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 236 | type Reunsafe(ferenc)e<'a>; | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:265:14 | 265 | type R; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 265 | type unsafe(R); | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:267:41 | 267 | fn r_return_primitive() -> usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 267 | fn r_return_primitive() -> usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:268:39 | 268 | fn r_return_shared() -> Shared; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 268 | fn r_return_shared() -> Sharedunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:269:36 | 269 | fn r_return_box() -> Box<R>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 269 | fn r_return_box() -> Box<R>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:270:49 | 270 | fn r_return_unique_ptr() -> UniquePtr<C>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 270 | fn r_return_unique_ptr() -> UniquePtr<C>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:271:49 | 271 | fn r_return_shared_ptr() -> SharedPtr<C>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 271 | fn r_return_shared_ptr() -> SharedPtr<C>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:272:51 | 272 | fn r_return_ref(shared: &Shared) -> &usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 272 | fn r_return_ref(shared: &Shared) -> &usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:273:59 | 273 | fn r_return_mut(shared: &mut Shared) -> &mut usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 273 | fn r_return_mut(shared: &mut Shared) -> &mut usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:274:49 | 274 | fn r_return_str(shared: &Shared) -> &str; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 274 | fn r_return_str(shared: &Shared) -> &strunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:275:54 | 275 | fn r_return_sliceu8(shared: &Shared) -> &[u8]; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 275 | fn r_return_sliceu8(shared: &Shared) -> &[u8]unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:276:62 | 276 | fn r_return_mutsliceu8(slice: &mut [u8]) -> &mut [u8]; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 276 | fn r_return_mutsliceu8(slice: &mut [u8]) -> &mut [u8]unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:277:44 | 277 | fn r_return_rust_string() -> String; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 277 | fn r_return_rust_string() -> Stringunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:278:64 | 278 | fn r_return_unique_ptr_string() -> UniquePtr<CxxString>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 278 | fn r_return_unique_ptr_string() -> UniquePtr<CxxString>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:279:42 | 279 | fn r_return_rust_vec() -> Vec<u8>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 279 | fn r_return_rust_vec() -> Vec<u8>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:280:53 | 280 | fn r_return_rust_vec_string() -> Vec<String>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 280 | fn r_return_rust_vec_string() -> Vec<String>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:281:57 | 281 | fn r_return_rust_vec_extern_struct() -> Vec<Job>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 281 | fn r_return_rust_vec_extern_struct() -> Vec<Job>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:282:62 | 282 | fn r_return_ref_rust_vec(shared: &Shared) -> &Vec<u8>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 282 | fn r_return_ref_rust_vec(shared: &Shared) -> &Vec<u8>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:283:70 | 283 | fn r_return_mut_rust_vec(shared: &mut Shared) -> &mut Vec<u8>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 283 | fn r_return_mut_rust_vec(shared: &mut Shared) -> &mut Vec<u8>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:284:48 | 284 | fn r_return_identity(_: usize) -> usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 284 | fn r_return_identity(_: usize) -> usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:285:53 | 285 | fn r_return_sum(_: usize, _: usize) -> usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 285 | fn r_return_sum(_: usize, _: usize) -> usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:286:41 | 286 | fn r_return_enum(n: u32) -> Enum; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 286 | fn r_return_enum(n: u32) -> Enumunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:288:38 | 288 | fn r_take_primitive(n: usize); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 288 | fn r_take_primitive(n: usize)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:289:41 | 289 | fn r_take_shared(shared: Shared); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 289 | fn r_take_shared(shared: Shared)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:290:33 | 290 | fn r_take_box(r: Box<R>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 290 | fn r_take_box(r: Box<R>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:291:46 | 291 | fn r_take_unique_ptr(c: UniquePtr<C>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 291 | fn r_take_unique_ptr(c: UniquePtr<C>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:292:46 | 292 | fn r_take_shared_ptr(c: SharedPtr<C>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 292 | fn r_take_shared_ptr(c: SharedPtr<C>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:293:31 | 293 | fn r_take_ref_r(r: &R); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 293 | fn r_take_ref_r(r: &R)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:294:31 | 294 | fn r_take_ref_c(c: &C); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 294 | fn r_take_ref_c(c: &C)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:295:31 | 295 | fn r_take_str(s: &str); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 295 | fn r_take_str(s: &str)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:296:43 | 296 | fn r_take_slice_char(s: &[c_char]); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 296 | fn r_take_slice_char(s: &[c_char])unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:297:41 | 297 | fn r_take_rust_string(s: String); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 297 | fn r_take_rust_string(s: String)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:298:61 | 298 | fn r_take_unique_ptr_string(s: UniquePtr<CxxString>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 298 | fn r_take_unique_ptr_string(s: UniquePtr<CxxString>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:299:48 | 299 | fn r_take_ref_vector(v: &CxxVector<u8>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 299 | fn r_take_ref_vector(v: &CxxVector<u8>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:300:55 | 300 | fn r_take_ref_empty_vector(v: &CxxVector<u64>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 300 | fn r_take_ref_empty_vector(v: &CxxVector<u64>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:301:39 | 301 | fn r_take_rust_vec(v: Vec<u8>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 301 | fn r_take_rust_vec(v: Vec<u8>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:302:50 | 302 | fn r_take_rust_vec_string(v: Vec<String>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 302 | fn r_take_rust_vec_string(v: Vec<String>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:303:44 | 303 | fn r_take_ref_rust_vec(v: &Vec<u8>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 303 | fn r_take_ref_rust_vec(v: &Vec<u8>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:304:55 | 304 | fn r_take_ref_rust_vec_string(v: &Vec<String>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 304 | fn r_take_ref_rust_vec_string(v: &Vec<String>)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:305:32 | 305 | fn r_take_enum(e: Enum); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 305 | fn r_take_enum(e: Enum)unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:307:45 | 307 | fn r_try_return_void() -> Result<()>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 307 | fn r_try_return_void() -> Result<()>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:308:53 | 308 | fn r_try_return_primitive() -> Result<usize>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 308 | fn r_try_return_primitive() -> Result<usize>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:309:48 | 309 | fn r_try_return_box() -> Result<Box<R>>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 309 | fn r_try_return_box() -> Result<Box<R>>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:310:54 | 310 | fn r_fail_return_primitive() -> Result<usize>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 310 | fn r_fail_return_primitive() -> Result<usize>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:311:59 | 311 | fn r_try_return_sliceu8(s: &[u8]) -> Result<&[u8]>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 311 | fn r_try_return_sliceu8(s: &[u8]) -> Result<&[u8]>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:312:70 | 312 | fn r_try_return_mutsliceu8(s: &mut [u8]) -> Result<&mut [u8]>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 312 | fn r_try_return_mutsliceu8(s: &mut [u8]) -> Result<&mut [u8]>unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:314:34 | 314 | fn get(self: &R) -> usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 314 | fn get(self: &R) -> usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:315:48 | 315 | fn set(self: &mut R, n: usize) -> usize; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 315 | fn set(self: &mut R, n: usize) -> usizeunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:316:55 | 316 | fn r_method_on_shared(self: &Shared) -> String; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 316 | fn r_method_on_shared(self: &Shared) -> Stringunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:317:48 | 317 | fn r_get_array_sum(self: &Array) -> i32; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 317 | fn r_get_array_sum(self: &Array) -> i32unsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:320:48 | 320 | fn r_aliased_function(x: i32) -> String; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 320 | fn r_aliased_function(x: i32) -> Stringunsafe(;) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:344:22 | 344 | impl Box<Shared> {} | ^^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 344 | impl Box<Shared> {unsafe(}) | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:78:27 | 78 | second: Box<Second>, | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 78 | second: Box<Secondunsafe(>), | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:105:35 | 105 | fn c_return_box() -> Box<R>; | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 105 | fn c_return_box() -> Box<Runsafe(>); | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:157:48 | 157 | fn c_take_rust_vec_shared(v: Vec<Shared>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 157 | fn c_take_rust_vec_shared(v: Vec<Sharedunsafe(>)); | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:181:52 | 181 | fn c_take_rust_vec_ns_shared(v: Vec<AShared>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 181 | fn c_take_rust_vec_ns_shared(v: Vec<ASharedunsafe(>)); | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:182:60 | 182 | fn c_take_rust_vec_nested_ns_shared(v: Vec<ABShared>); | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 182 | fn c_take_rust_vec_nested_ns_shared(v: Vec<ABSharedunsafe(>)); | +++++++ + warning: unsafe attribute used without unsafe --> tests/ffi/lib.rs:329:22 | 329 | vec: Vec<Dag3>, | ^ usage of unsafe attribute | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> help: wrap the attribute in `unsafe(...)` | 329 | vec: Vec<Dag3unsafe(>), | +++++++ + warning: extern blocks should be unsafe --> tests/ffi/module.rs:12:46 | 12 | fn c_take_unique_ptr(c: UniquePtr<C>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> = note: `#[warn(missing_unsafe_on_extern)]` implied by `#[warn(rust_2024_compatibility)]` warning: extern blocks should be unsafe --> tests/ffi/module.rs:33:47 | 33 | fn c_take_trivial_ptr(d: UniquePtr<D>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:34:37 | 34 | fn c_take_trivial_ref(d: &D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:35:45 | 35 | fn c_take_trivial_mut_ref(d: &mut D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:36:46 | 36 | fn c_take_trivial_pin_ref(d: Pin<&D>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:37:54 | 37 | fn c_take_trivial_pin_mut_ref(d: Pin<&mut D>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:38:47 | 38 | fn c_take_trivial_ref_method(self: &D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:39:55 | 39 | fn c_take_trivial_mut_ref_method(self: &mut D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:40:32 | 40 | fn c_take_trivial(d: D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:41:50 | 41 | fn c_take_trivial_ns_ptr(g: UniquePtr<G>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:42:40 | 42 | fn c_take_trivial_ns_ref(g: &G); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:43:35 | 43 | fn c_take_trivial_ns(g: G); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:44:46 | 44 | fn c_take_opaque_ptr(e: UniquePtr<E>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:45:36 | 45 | fn c_take_opaque_ref(e: &E); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:46:46 | 46 | fn c_take_opaque_ref_method(self: &E); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:47:59 | 47 | fn c_take_opaque_mut_ref_method(self: Pin<&mut E>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:48:49 | 48 | fn c_take_opaque_ns_ptr(e: UniquePtr<F>); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:49:39 | 49 | fn c_take_opaque_ns_ref(e: &F); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:50:50 | 50 | fn c_return_trivial_ptr() -> UniquePtr<D>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:51:35 | 51 | fn c_return_trivial() -> D; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:52:53 | 52 | fn c_return_trivial_ns_ptr() -> UniquePtr<G>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:53:38 | 53 | fn c_return_trivial_ns() -> G; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:54:49 | 54 | fn c_return_opaque_ptr() -> UniquePtr<E>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:55:66 | 55 | fn c_return_opaque_mut_pin(e: Pin<&mut E>) -> Pin<&mut E>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:56:52 | 56 | fn c_return_ns_opaque_ptr() -> UniquePtr<F>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:57:52 | 57 | fn c_return_ns_unique_ptr() -> UniquePtr<H>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:58:34 | 58 | fn c_take_ref_ns_c(h: &H); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:61:35 | 61 | fn ns_c_take_trivial(d: D); | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:63:38 | 63 | fn ns_c_return_trivial() -> D; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:68:32 | 68 | fn get(self: &I) -> u32; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:71:55 | 71 | fn ns_c_return_unique_ptr_ns() -> UniquePtr<I>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:74:23 | 74 | impl UniquePtr<D> {} | -^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:75:23 | 75 | impl UniquePtr<E> {} | -^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743> warning: extern blocks should be unsafe --> tests/ffi/module.rs:76:23 | 76 | impl UniquePtr<F> {} | -^ | | | help: needs `unsafe` before the extern keyword: `unsafe` …
This is a tracking issue for RFC 3325: unsafe attributes
RFC: rust-lang/rfcs#3325`#![feature(unsafe_attributes)]`
Issues: F-unsafe_attributes
The feature gate for the issue is
#![feature(unsafe_attributes)]
.For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see this comment here
About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
unsafe_attributes
#128771Unresolved Questions
no_mangle
outsideunsafe(...)
could be staged in various ways: it could be warn-by-default to start or we wait a while before to do that, it could be edition-dependent, it might eventually be deny-by-default or even a hard error on some editions -- there are lots of details here, which can be determined later during the process.Implementation history
cc @RalfJung @carbotaniuman @rust-lang/style
This issue has been assigned to @carbotaniuman via this comment.
The text was updated successfully, but these errors were encountered: