forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#128298 - matthiaskrgr:rollup-0wdu2wo, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#127853 (`#[naked]`: report incompatible attributes) - rust-lang#128276 (Add a README to rustbook to explain its purpose) - rust-lang#128279 (Stabilize `is_sorted`) - rust-lang#128282 (bitwise and bytewise methods on `NonZero`) - rust-lang#128285 (rustc book: document how the RUST_TARGET_PATH variable is used) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
39 changed files
with
874 additions
and
236 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
`#[track_caller]` and `#[naked]` cannot both be applied to the same function. | ||
Functions marked with the `#[naked]` attribute are restricted in what other | ||
attributes they may be marked with. | ||
|
||
Notable attributes that are incompatible with `#[naked]` are: | ||
|
||
* `#[inline]` | ||
* `#[track_caller]` | ||
* `#[test]`, `#[ignore]`, `#[should_panic]` | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0736 | ||
#[inline] | ||
#[naked] | ||
#[track_caller] | ||
fn foo() {} | ||
``` | ||
|
||
This is primarily due to ABI incompatibilities between the two attributes. | ||
See [RFC 2091] for details on this and other limitations. | ||
|
||
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md | ||
These incompatibilities are due to the fact that naked functions deliberately | ||
impose strict restrictions regarding the code that the compiler is | ||
allowed to produce for this function. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.