Skip to content

Spec abi chapter #1545

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

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8116b5e
Start `abi` chapter.
chorman0773 Jul 22, 2024
48be95a
Clarify that `extern "Rust"` is safe, even when simd types are used
chorman0773 Jul 24, 2024
fee9c23
Cleanup styling of abi chapter
chorman0773 Jul 24, 2024
b5c0528
Link to section that lists abi chapters
chorman0773 Jul 24, 2024
15e1563
Add links to clauses in abi chapter
chorman0773 Jul 24, 2024
d10ef05
Add tests to abi chapter
chorman0773 Jul 24, 2024
e10129a
Fix style issues from CI
chorman0773 Jul 24, 2024
8b7d4df
Fix "File Must End with a newline" error
chorman0773 Jul 24, 2024
6d695cd
Fix broken links to abi chapter
chorman0773 Jul 24, 2024
92c0c94
Apply suggestions from code review
chorman0773 Jul 25, 2024
5c441ea
Make suggested changes from PR comments
chorman0773 Jul 26, 2024
3f5ca53
Apply suggestions from code review
chorman0773 Jul 26, 2024
b99883a
Elaborate more on *abi compatible* and *simd abi requirements*. Remov…
chorman0773 Jul 26, 2024
0d0635b
Add introductory clauses and reformat to use existing grammar style
chorman0773 Jul 26, 2024
073ca42
Add additional explanations to the abi compatibility section
chorman0773 Sep 22, 2024
7dd5425
Fix style issues
chorman0773 Sep 22, 2024
97cd91f
Fix broken links
chorman0773 Sep 22, 2024
e4c62ac
Indicate that all types subject to mandatory discriminant elision are…
chorman0773 Oct 21, 2024
cbc8349
Fix link reference to be the correct identifier
chorman0773 Oct 21, 2024
36f80c3
Fix "Lines must not end with spaces" error
chorman0773 Oct 21, 2024
79a248d
Remove simd abi requirements from definition and ensure that the retu…
chorman0773 Nov 11, 2024
4c219fc
Merge branch 'master' into spec-abi-chapter
chorman0773 Dec 11, 2024
1582d3f
Apply suggestions from code review
chorman0773 Dec 11, 2024
2afe85e
Fix abi chapter tests to comply with edition 2024
chorman0773 Dec 12, 2024
5be0423
Fix parenthesis on `unsafe(no_mangle)`
chorman0773 Dec 12, 2024
ce0915c
Move clause about abi-compatibility being an equivalence relation unt…
chorman0773 Dec 12, 2024
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
Prev Previous commit
Next Next commit
Fix abi chapter tests to comply with edition 2024
  • Loading branch information
chorman0773 authored Dec 12, 2024
commit 2afe85e7905a2813c5fe3146a9384e1b51f55f77
22 changes: 11 additions & 11 deletions src/abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,21 @@ r[abi.symbol-name.names]
The *`export_name` attribute* shall only be applied to a `static` or `fn` item. The *`export_name` attribute* shall not be applied to an item declared within an [`extern` block].

```rust
#[no_mangle]
#[unsafe(no_mangle(]
extern "C" fn foo(x: i32) -> i32 {
x + 1
}

#[export_name = "bar"]
#[unsafe(export_name = "bar")]
extern "C" fn baz(x: i32) -> i32 {
x + 2
}
```

```rust,compile_fail
extern "C" {
#[export_name = "foo"]
fn __foo(x: i32) -> i32; // error: not a free function, impl method, or static
unsafe extern "C" {
#[unsafe(export_name = "foo")]
unsafe fn __foo(x: i32) -> i32; // error: not a free function, impl method, or static
}
```

Expand All @@ -284,11 +284,11 @@ r[abi.symbol-name.no_mangle]
The *`no_mangle` attribute* may be specified as a built-in attribute, using the [_MetaWord_] syntax. The *export name* of an item with the *`no_mangle` attribute* is the declaration name of the item.

```rust
extern "C" {
fn bar() -> i32;
unsafe extern "C" {
unsafe fn bar() -> i32;
}
mod inner{
#[no_mangle]
#[unsafe(no_mangle)]
extern "C" fn bar() -> i32 {
0
}
Expand All @@ -304,11 +304,11 @@ r[abi.symbol-name.export_name]
The *`export_name` attribute* may be specified as a built-in attribute, using the [_MetaNameValueStr_] syntax. The *export name* of an item with the *`no_mangle` attribute* is the content of `STRING_LITERAL`.

```rust
extern "C" {
fn bar() -> i32;
unsafe extern "C" {
unsafe fn bar() -> i32;
}
mod inner{
#[export_name = "bar"]
#[unsafe(export_name = "bar")]
extern "C" fn __some_other_item_name() -> i32 {
0
}
Expand Down
Loading