Rollup merge of #65037 - anp:track-caller, r=oli-obk
`#[track_caller]` feature gate (RFC 2091 1/N) RFC text: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md Tracking issue: https://github.com/rust-lang/rust/issues/47809 I started with @ayosec's commit to add the feature gate with tests and rebased it onto current master. I fixed up some tidy lints and added a test.
This commit is contained in:
commit
ae5bb7e289
28 changed files with 395 additions and 2 deletions
|
|
@ -2120,6 +2120,25 @@ These attributes are meant to only be used by the standard library and are
|
|||
rejected in your own crates.
|
||||
"##,
|
||||
|
||||
E0736: r##"
|
||||
#[track_caller] and #[naked] cannot be applied to the same function.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0736
|
||||
#![feature(track_caller)]
|
||||
|
||||
#[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
|
||||
"##,
|
||||
|
||||
;
|
||||
// E0006, // merged with E0005
|
||||
// E0101, // replaced with E0282
|
||||
|
|
@ -2179,4 +2198,5 @@ rejected in your own crates.
|
|||
E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
|
||||
E0727, // `async` generators are not yet supported
|
||||
E0728, // `await` must be in an `async` function or block
|
||||
E0739, // invalid track_caller application/syntax
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue