-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Incorrect help suggestion in "unsafe attribute used without unsafe" error #149756
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.F-unsafe_attributes`#![feature(unsafe_attributes)]``#![feature(unsafe_attributes)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2024Area: The 2024 editionArea: The 2024 editionA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.F-unsafe_attributes`#![feature(unsafe_attributes)]``#![feature(unsafe_attributes)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I am upgrading the editions used in github.com/rust-gpu/rust-cuda. When I upgrade
cuda_std_macrosfrom 2018 to 2024 with this patch:and then build rust-cuda with
cargo buildI get warnings like this:The suggestion
unsafe(#[kernel])is bogus. At first I thought it should instead say#[unsafe(kernel)], but that is also bogus. The real issue is that#[kernel]produces code that uses#[no_mangle], and the real fix is to change that (inside the macro) to#[unsafe(no_mangle)]. It's probably difficult to explain that in the error message, but in lieu of that it would be nice if the bogushelp:was omitted.