Skip to content

Commit

Permalink
Rollup merge of #70700 - jrvidal:include-macro-paths, r=Dylan-DPC
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Centril authored Apr 2, 2020
2 parents c00a21c + 65fcc3f commit 28084a1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/libcore/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 28084a1

Please sign in to comment.