Skip to content

Commit

Permalink
Merge pull request #872 from lcnr/patch-1
Browse files Browse the repository at this point in the history
mention that `#[track_caller]` on `fn main` is forbidden
  • Loading branch information
ehuss authored Aug 5, 2020
2 parents c9b2736 + bc1a708 commit 90fb49f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/attributes/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ feature detection on the x86 platforms.
## The `track_caller` attribute

The `track_caller` attribute may be applied to any function with [`"Rust"` ABI][rust-abi]. When
applied to functions and methods in trait declarations, the attribute applies to all
implementations. If the trait provides a default implementation with the attribute, then the
attribute also applies to override implementations.
The `track_caller` attribute may be applied to any function with [`"Rust"` ABI][rust-abi]
with the exception of the entry point `fn main`. When applied to functions and methods in
trait declarations, the attribute applies to all implementations. If the trait provides a
default implementation with the attribute, then the attribute also applies to override implementations.

When applied to a function in an `extern` block the attribute must also be applied to any linked
implementations, otherwise undefined behavior results. When applied to a function which is made
Expand Down

0 comments on commit 90fb49f

Please sign in to comment.