-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 3484: Unsafe Extern Blocks #123743
Comments
I have been reviewing some work (and the required refactorings), and the refactorings need refactorings of their own (not sure how many layers of turtles are needed, but it's not all the way down) 😓 The only way to get it done in time is to not do refactorings before, but just leave FIXMEs, which doesn't sit right with me. So: let's not do this for the 2024 edition, but jump straight into implementing the 2027 edition |
…li-obk Unsafe extern blocks This implements RFC 3484. Tracking issue rust-lang#123743 and RFC rust-lang/rfcs#3484 This is better reviewed commit by commit.
@rustbot labels +I-style-nominated Let's nominate to discuss this for visibility on the style side. One style-related question here would be whether we want |
…li-obk Unsafe extern blocks This implements RFC 3484. Tracking issue rust-lang#123743 and RFC rust-lang/rfcs#3484 This is better reviewed commit by commit.
Edition docs are up at rust-lang/edition-guide#309. |
Properly gate `safe` keyword in pre-expansion This PR gates `safe` keyword in pre-expansion contexts. Should mitigate the fallout of rust-lang#126755, which is that `safe` is now usable on beta lol. r? `@spastorino` or `@oli-obk` cc rust-lang#124482 tracking rust-lang#123743
Rollup merge of rust-lang#126973 - chenyukang:yukang-fix-126756-unsafe-suggestion-error, r=spastorino Fix bad replacement for unsafe extern block suggestion Fixes rust-lang#126756 r? ``@spastorino`` link rust-lang#123743
…locks-diagnostics, r=compiler-errors Improve unsafe extern blocks diagnostics Closes rust-lang#126327 For this code: ```rust extern { pub fn foo(); pub safe fn bar(); } ``` We get ... ``` error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ | help: add unsafe to this `extern` block | 1 | unsafe extern { | ++++++ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. ``` And then making the extern block unsafe, we get ... ``` error: extern block cannot be declared unsafe --> test.rs:1:1 | 1 | unsafe extern { | ^^^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. ``` r? `@compiler-errors`
…locks-diagnostics, r=compiler-errors Improve unsafe extern blocks diagnostics Closes rust-lang#126327 For this code: ```rust extern { pub fn foo(); pub safe fn bar(); } ``` We get ... ``` error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ | help: add unsafe to this `extern` block | 1 | unsafe extern { | ++++++ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. ``` And then making the extern block unsafe, we get ... ``` error: extern block cannot be declared unsafe --> test.rs:1:1 | 1 | unsafe extern { | ^^^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. ``` r? ``@compiler-errors``
Rollup merge of rust-lang#127106 - spastorino:improve-unsafe-extern-blocks-diagnostics, r=compiler-errors Improve unsafe extern blocks diagnostics Closes rust-lang#126327 For this code: ```rust extern { pub fn foo(); pub safe fn bar(); } ``` We get ... ``` error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ | help: add unsafe to this `extern` block | 1 | unsafe extern { | ++++++ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. ``` And then making the extern block unsafe, we get ... ``` error: extern block cannot be declared unsafe --> test.rs:1:1 | 1 | unsafe extern { | ^^^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: items in unadorned `extern` blocks cannot have safety qualifiers --> test.rs:3:5 | 3 | pub safe fn bar(); | ^^^^^^^^^^^^^^^^^^ error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> test.rs:3:9 | 3 | pub safe fn bar(); | ^^^^ | = note: see issue rust-lang#123743 <rust-lang#123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. ``` r? ``@compiler-errors``
…-blocks, r=compiler-errors Stabilize unsafe extern blocks (RFC 3484) # Stabilization report ## Summary This is a tracking issue for the RFC 3484: Unsafe Extern Blocks We are stabilizing `#![feature(unsafe_extern_blocks)]`, as described in [Unsafe Extern Blocks RFC 3484](rust-lang/rfcs#3484). This feature makes explicit that declaring an extern block is unsafe. Starting in Rust 2024, all extern blocks must be marked as unsafe. In all editions, items within unsafe extern blocks may be marked as safe to use. RFC: rust-lang/rfcs#3484 Tracking issue: rust-lang#123743 ## What is stabilized ### Summary of stabilization We now need extern blocks to be marked as unsafe and items inside can also have safety modifiers (unsafe or safe), by default items with no modifiers are unsafe to offer easy migration without surprising results. ```rust unsafe extern { // sqrt (from libm) may be called with any `f64` pub safe fn sqrt(x: f64) -> f64; // strlen (from libc) requires a valid pointer, // so we mark it as being an unsafe fn pub unsafe fn strlen(p: *const c_char) -> usize; // this function doesn't say safe or unsafe, so it defaults to unsafe pub fn free(p: *mut core::ffi::c_void); pub safe static IMPORTANT_BYTES: [u8; 256]; pub safe static LINES: SyncUnsafeCell<i32>; } ``` ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-extern-blocks`. ## History - rust-lang#124482 - rust-lang#124455 - rust-lang#125077 - rust-lang#125522 - rust-lang#126738 - rust-lang#126749 - rust-lang#126755 - rust-lang#126757 - rust-lang#126758 - rust-lang#126756 - rust-lang#126973 - rust-lang#127535 - rust-lang/rustfmt#6204 ## Unresolved questions I am not aware of any unresolved questions.
…-blocks, r=compiler-errors Stabilize unsafe extern blocks (RFC 3484) # Stabilization report ## Summary This is a tracking issue for the RFC 3484: Unsafe Extern Blocks We are stabilizing `#![feature(unsafe_extern_blocks)]`, as described in [Unsafe Extern Blocks RFC 3484](rust-lang/rfcs#3484). This feature makes explicit that declaring an extern block is unsafe. Starting in Rust 2024, all extern blocks must be marked as unsafe. In all editions, items within unsafe extern blocks may be marked as safe to use. RFC: rust-lang/rfcs#3484 Tracking issue: rust-lang#123743 ## What is stabilized ### Summary of stabilization We now need extern blocks to be marked as unsafe and items inside can also have safety modifiers (unsafe or safe), by default items with no modifiers are unsafe to offer easy migration without surprising results. ```rust unsafe extern { // sqrt (from libm) may be called with any `f64` pub safe fn sqrt(x: f64) -> f64; // strlen (from libc) requires a valid pointer, // so we mark it as being an unsafe fn pub unsafe fn strlen(p: *const c_char) -> usize; // this function doesn't say safe or unsafe, so it defaults to unsafe pub fn free(p: *mut core::ffi::c_void); pub safe static IMPORTANT_BYTES: [u8; 256]; pub safe static LINES: SyncUnsafeCell<i32>; } ``` ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-extern-blocks`. ## History - rust-lang#124482 - rust-lang#124455 - rust-lang#125077 - rust-lang#125522 - rust-lang#126738 - rust-lang#126749 - rust-lang#126755 - rust-lang#126757 - rust-lang#126758 - rust-lang#126756 - rust-lang#126973 - rust-lang#127535 - rust-lang/rustfmt#6204 ## Unresolved questions I am not aware of any unresolved questions.
Rollup merge of rust-lang#127921 - spastorino:stabilize-unsafe-extern-blocks, r=compiler-errors Stabilize unsafe extern blocks (RFC 3484) # Stabilization report ## Summary This is a tracking issue for the RFC 3484: Unsafe Extern Blocks We are stabilizing `#![feature(unsafe_extern_blocks)]`, as described in [Unsafe Extern Blocks RFC 3484](rust-lang/rfcs#3484). This feature makes explicit that declaring an extern block is unsafe. Starting in Rust 2024, all extern blocks must be marked as unsafe. In all editions, items within unsafe extern blocks may be marked as safe to use. RFC: rust-lang/rfcs#3484 Tracking issue: rust-lang#123743 ## What is stabilized ### Summary of stabilization We now need extern blocks to be marked as unsafe and items inside can also have safety modifiers (unsafe or safe), by default items with no modifiers are unsafe to offer easy migration without surprising results. ```rust unsafe extern { // sqrt (from libm) may be called with any `f64` pub safe fn sqrt(x: f64) -> f64; // strlen (from libc) requires a valid pointer, // so we mark it as being an unsafe fn pub unsafe fn strlen(p: *const c_char) -> usize; // this function doesn't say safe or unsafe, so it defaults to unsafe pub fn free(p: *mut core::ffi::c_void); pub safe static IMPORTANT_BYTES: [u8; 256]; pub safe static LINES: SyncUnsafeCell<i32>; } ``` ## Tests The relevant tests are in `tests/ui/rust-2024/unsafe-extern-blocks`. ## History - rust-lang#124482 - rust-lang#124455 - rust-lang#125077 - rust-lang#125522 - rust-lang#126738 - rust-lang#126749 - rust-lang#126755 - rust-lang#126757 - rust-lang#126758 - rust-lang#126756 - rust-lang#126973 - rust-lang#127535 - rust-lang/rustfmt#6204 ## Unresolved questions I am not aware of any unresolved questions.
@rustbot labels -S-tracking-ready-to-stabilize +S-tracking-ready-for-edition With the merge of #127921, this item is now ready for Rust 2024. Thanks to @spastorino for pushing this important work to completion. |
…-style-guide, r=compiler-errors Add unsafe to extern blocks in style guide This goes after this is merged: - rust-lang#127921 r? `@traviscross` Tracking: - rust-lang#123743
…-style-guide, r=compiler-errors Add unsafe to extern blocks in style guide This goes after this is merged: - rust-lang#127921 r? ``@traviscross`` Tracking: - rust-lang#123743
Rollup merge of rust-lang#127922 - spastorino:unsafe-extern-blocks-in-style-guide, r=compiler-errors Add unsafe to extern blocks in style guide This goes after this is merged: - rust-lang#127921 r? ``@traviscross`` Tracking: - rust-lang#123743
…ide, r=compiler-errors Add unsafe to extern blocks in style guide This goes after this is merged: - rust-lang/rust#127921 r? ``@traviscross`` Tracking: - rust-lang/rust#123743
…r=GuillaumeGomez rustdoc-json: Add tests for unsafe/safe extern blocks (RFC 3484) Closes rust-lang#126786, turns out this all Just Works (TM) Tracking issue: rust-lang#123743 r? `@GuillaumeGomez`
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 the RFC 3484: Unsafe Extern Blocks
RFC: rust-lang/rfcs#3484`#![feature(unsafe_extern_blocks)]`
Issues: F-unsafe_extern_blocks
The feature gate for the issue is
#![feature(unsafe_extern_blocks)]
.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_code
lint forunsafe extern
blocksunsafe
blocks do not fireunsafe_code
lint #126738Related
unsafe
blocks do not fireunsafe_code
lint #126738safe
keyword is allowed in all function contexts #126749safe
keyword is not feature-gated #126755safe
keyword in pre-expansion #126757cc @Lokathor @spastorino
The text was updated successfully, but these errors were encountered: