1
Fork 0

E073[6-8] include failing code examples.

This commit is contained in:
Adam Perry 2019-10-04 14:19:05 -07:00
parent 8992c30db4
commit bdc4bd142b
2 changed files with 43 additions and 4 deletions

View file

@ -2078,6 +2078,16 @@ 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.

View file

@ -4909,15 +4909,44 @@ and the pin is required to keep it in the same place in memory.
"##,
E0737: r##"
#[track_caller] requires functions to have the "Rust" ABI for passing caller
location. See [RFC 2091] for details on this and other restrictions.
#[track_caller] requires functions to have the "Rust" ABI for implicitly
receiving caller location. See [RFC 2091] for details on this and other
restrictions.
Erroneous code example:
```compile_fail,E0737
#![feature(track_caller)]
#[track_caller]
extern "C" fn foo() {}
```
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
"##,
E0738: r##"
#[track_caller] cannot be applied to trait methods. See [RFC 2091]
for details on this and other restrictions.
#[track_caller] cannot be applied to trait methods.
This is due to limitations in the compiler which are likely to be temporary.
See [RFC 2091] for details on this and other restrictions.
Erroneous code example:
```compile_fail,E0738
#![feature(track_caller)]
trait Foo {
fn bar(&self);
}
struct Bar;
impl Foo for Bar {
#[track_caller]
fn bar(&self) {}
}
```
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
"##,