Skip to content

Commit 8991ffc

Browse files
authored
Auto merge of #36404 - christopherdumas:master, r=GuillaumeGomez
Documentation change to macros.rs for `includes!` I'm not sure if this documentation is clear or extensive enough, but this is just to get started on the problem, fixes issue #36387.
2 parents 791fb77 + 3660a79 commit 8991ffc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/libstd/macros.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,16 @@ pub mod builtin {
450450
#[macro_export]
451451
macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) }
452452

453-
/// Parse the current given file as an expression.
454-
///
455-
/// This is generally a bad idea, because it's going to behave unhygienically.
453+
/// Parse the file provided in the argument as an expression or an
454+
/// item according to the context. This file is located relative
455+
/// to the current file (similarly to how modules are found).
456+
///
457+
/// Using this macro is often a bad idea, because if the file is
458+
/// parsed as an expression, it is going to be placed in the
459+
/// surrounding code unhygenically. This could result in variables
460+
/// or functions being different from what the file expected if
461+
/// there are variables or functions that have the same name in
462+
/// the current file.
456463
///
457464
/// # Examples
458465
///

0 commit comments

Comments
 (0)