Conversation
fixes:
```
error: `#[no_mangle]` cannot be used on internal language items
--> src/lib.rs:47:1
|
47 | #[no_mangle]
| ^^^^^^^^^^^^
48 | fn panic(_info: &PanicInfo) -> ! {
| -------------------------------- should be the internal language item
|
= note: Rustc requires this item to have a specific mangled name.
= note: If you are trying to prevent mangling to ease debugging, many
= note: debuggers support a command such as `rbreak rust_begin_unwind` to
= note: match `.*rust_begin_unwind.*` instead of `break rust_begin_unwind` on a specific name
error: could not compile `no-std-check` (lib) due to 1 previous error
```
There was a problem hiding this comment.
Pull Request Overview
This PR attempts to address a compile error by changing the #[no_mangle] attribute on the panic handler to an #[unsafe(no_mangle)] form.
- Updated the panic handler’s attribute from
#[no_mangle]to#[unsafe(no_mangle)]
Comments suppressed due to low confidence (1)
tools/no-std-check/src/lib.rs:47
- The attribute
#[unsafe(no_mangle)]is not valid Rust syntax. Remove this attribute—#[panic_handler]is a language item and should not useno_manglehere. If you need to match the panic symbol in a debugger, rely on regex-based breakpoints instead.
#[unsafe(no_mangle)]
no_mangle attr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: