File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change @@ -2237,6 +2237,16 @@ rejected in your own crates.
22372237E0736 : r##"
22382238#[track_caller] and #[naked] cannot be applied to the same function.
22392239
2240+ Erroneous code example:
2241+
2242+ ```compile_fail,E0736
2243+ #![feature(track_caller)]
2244+
2245+ #[naked]
2246+ #[track_caller]
2247+ fn foo() {}
2248+ ```
2249+
22402250This is primarily due to ABI incompatibilities between the two attributes.
22412251See [RFC 2091] for details on this and other limitations.
22422252
Original file line number Diff line number Diff line change @@ -4909,15 +4909,44 @@ and the pin is required to keep it in the same place in memory.
49094909"## ,
49104910
49114911E0737 : r##"
4912- #[track_caller] requires functions to have the "Rust" ABI for passing caller
4913- location. See [RFC 2091] for details on this and other restrictions.
4912+ #[track_caller] requires functions to have the "Rust" ABI for implicitly
4913+ receiving caller location. See [RFC 2091] for details on this and other
4914+ restrictions.
4915+
4916+ Erroneous code example:
4917+
4918+ ```compile_fail,E0737
4919+ #![feature(track_caller)]
4920+
4921+ #[track_caller]
4922+ extern "C" fn foo() {}
4923+ ```
49144924
49154925[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
49164926"## ,
49174927
49184928E0738 : r##"
4919- #[track_caller] cannot be applied to trait methods. See [RFC 2091]
4920- for details on this and other restrictions.
4929+ #[track_caller] cannot be applied to trait methods.
4930+
4931+ This is due to limitations in the compiler which are likely to be temporary.
4932+ See [RFC 2091] for details on this and other restrictions.
4933+
4934+ Erroneous code example:
4935+
4936+ ```compile_fail,E0738
4937+ #![feature(track_caller)]
4938+
4939+ trait Foo {
4940+ fn bar(&self);
4941+ }
4942+
4943+ struct Bar;
4944+
4945+ impl Foo for Bar {
4946+ #[track_caller]
4947+ fn bar(&self) {}
4948+ }
4949+ ```
49214950
49224951[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
49234952"## ,
You can’t perform that action at this time.
0 commit comments