diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-04-03 00:32:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-03 00:32:06 +0200 |
| commit | 28084a1f36cf1703d1d27f5fca4a2098b1756f93 (patch) | |
| tree | a567421651ba96a6f5bbdf4ec4b6e839b7fa7b6b | |
| parent | c00a21c2e326fe9b7a6388a50e0a0a6167fb3aa0 (diff) | |
| parent | 65fcc3f1cdc623607a7529487a6b869b3a6c1943 (diff) | |
| download | rust-28084a1f36cf1703d1d27f5fca4a2098b1756f93.tar.gz rust-28084a1f36cf1703d1d27f5fca4a2098b1756f93.zip | |
Rollup merge of #70700 - jrvidal:include-macro-paths, r=Dylan-DPC
Expand on platform details of `include_xxx` macros This is a small detail that is not explicitly mentioned, but it left me scratching my head for a while until I looked into its implementation details. Maybe worth mentioning.
| -rw-r--r-- | src/libcore/macros/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libcore/macros/mod.rs b/src/libcore/macros/mod.rs index f67762cd043..9c885ef99a9 100644 --- a/src/libcore/macros/mod.rs +++ b/src/libcore/macros/mod.rs @@ -1070,8 +1070,10 @@ pub(crate) mod builtin { /// Includes a utf8-encoded file as a string. /// - /// The file is located relative to the current file. (similarly to how - /// modules are found) + /// The file is located relative to the current file (similarly to how + /// modules are found). The provided path is interpreted in a platform-specific + /// way at compile time. So, for instance, an invocation with a Windows path + /// containing backslashes `\` would not compile correctly on Unix. /// /// This macro will yield an expression of type `&'static str` which is the /// contents of the file. @@ -1108,8 +1110,10 @@ pub(crate) mod builtin { /// Includes a file as a reference to a byte array. /// - /// The file is located relative to the current file. (similarly to how - /// modules are found) + /// The file is located relative to the current file (similarly to how + /// modules are found). The provided path is interpreted in a platform-specific + /// way at compile time. So, for instance, an invocation with a Windows path + /// containing backslashes `\` would not compile correctly on Unix. /// /// This macro will yield an expression of type `&'static [u8; N]` which is /// the contents of the file. @@ -1202,7 +1206,9 @@ pub(crate) mod builtin { /// Parses a file as an expression or an item according to the context. /// /// The file is located relative to the current file (similarly to how - /// modules are found). + /// modules are found). The provided path is interpreted in a platform-specific + /// way at compile time. So, for instance, an invocation with a Windows path + /// containing backslashes `\` would not compile correctly on Unix. /// /// Using this macro is often a bad idea, because if the file is /// parsed as an expression, it is going to be placed in the |
