From bc1a70875865bd578b473a431fb66788fb635886 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Wed, 5 Aug 2020 16:02:24 +0200 Subject: [PATCH] mention that `#[track_caller]` on `fn main` is forbidden --- src/attributes/codegen.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 3713f3acd..d23a0244b 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -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