pub enum Builtin {
File,
FileName,
BaseFile,
Line,
IncludeLevel,
Counter,
}Expand description
A predefined macro whose value is a question rather than a replacement list.
__FILE__ and its relatives cannot be written as a body, because what they stand for
depends on where they are used rather than on what the target is. GCC calls these builtin
macros and answers them while expanding, and this is the same arrangement: the table holds
the name and which question it is, and crate::expand asks the source map when it meets
one. Everything else about them is ordinary, so #ifdef __FILE__ is true, #undef __FILE__ works, and redefining one warns the way redefining anything else does.
Variants§
File
__FILE__, the file the use is in, spelled as a string literal.
FileName
__FILE_NAME__, the same file with the directories taken off.
BaseFile
__BASE_FILE__, the file at the bottom of the include stack.
Line
__LINE__, the line the use is on.
IncludeLevel
__INCLUDE_LEVEL__, how many #include directives deep the use is.
Counter
__COUNTER__, a number that is different every time it is expanded.