5 ms·
Others have mentioned that include_str! is a macro, which I suppose it is. But if you look at the source it says that it is a compiler built-in[0]. If you dig i
by phyllostachys 8y ago
Others have mentioned that include_str! is a macro, which I suppose it is. But if you look at the source it says that it is a compiler built-in[0]. If you dig into that, you'll see that it happens inside the compiler[1] (well duh). I feel that that makes it slightly different than a normal macro in that it doesn't expand to a bunch of Rust code. I found that pretty neat.
[0] - https://github.com/rust-lang/rust/blob/master/src/libcore/macros.rs#L730-L741 https://github.com/rust-lang/rust/blob/master/src/libcore/ma...
[1] - https://github.com/rust-lang/rust/blob/e8af0f4c1f121263e55da29854208db0ae1fea54/src/libsyntax/ext/source_util.rs#L132-L166 https://github.com/rust-lang/rust/blob/e8af0f4c1f121263e55da...