Skip to content

Commit 90fb49f

Browse files
authored
Merge pull request #872 from lcnr/patch-1
mention that `#[track_caller]` on `fn main` is forbidden
2 parents c9b2736 + bc1a708 commit 90fb49f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/attributes/codegen.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ feature detection on the x86 platforms.
145145
146146
## The `track_caller` attribute
147147

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

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

0 commit comments

Comments
 (0)