Skip to content
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

2024: Add unsafe attribute differences #1579

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ with the same name (or with a well-known symbol), leading to undefined behavior.
extern "C" fn foo() {}
```

> **Edition differences**: Before the 2024 edition it is allowed to use the `no_mangle` attribute without the `unsafe` qualification.

## The `link_section` attribute

The *`link_section` attribute* specifies the section of the object file that a
Expand All @@ -90,6 +92,8 @@ of memory not expecting them, such as mutable data into read-only areas.
pub static VAR1: u32 = 1;
```

> **Edition differences**: Before the 2024 edition it is allowed to use the `link_section` attribute without the `unsafe` qualification.

## The `export_name` attribute

The *`export_name` attribute* specifies the name of the symbol that will be
Expand All @@ -105,6 +109,8 @@ behavior.
pub fn name_in_rust() { }
```

> **Edition differences**: Before the 2024 edition it is allowed to use the `export_name` attribute without the `unsafe` qualification.

[_MetaNameValueStr_]: attributes.md#meta-item-attribute-syntax
[`static` items]: items/static-items.md
[attribute]: attributes.md
Expand Down