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.
2237
2237
E0736 : r##"
2238
2238
#[track_caller] and #[naked] cannot be applied to the same function.
2239
2239
2240
+ Erroneous code example:
2241
+
2242
+ ```compile_fail,E0736
2243
+ #![feature(track_caller)]
2244
+
2245
+ #[naked]
2246
+ #[track_caller]
2247
+ fn foo() {}
2248
+ ```
2249
+
2240
2250
This is primarily due to ABI incompatibilities between the two attributes.
2241
2251
See [RFC 2091] for details on this and other limitations.
2242
2252
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.
4909
4909
"## ,
4910
4910
4911
4911
E0737 : 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
+ ```
4914
4924
4915
4925
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
4916
4926
"## ,
4917
4927
4918
4928
E0738 : 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
+ ```
4921
4950
4922
4951
[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
4923
4952
"## ,
You can’t perform that action at this time.
0 commit comments