-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from dtolnay/issue50
Add ui test of current behavior of capture in nested macro
- Loading branch information
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use indoc::indoc; | ||
|
||
fn main() { | ||
let world = "world"; | ||
println!(indoc!("Hello {world}")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: there is no argument named `world` | ||
--> tests/ui/capture-var-nested.rs:5:21 | ||
| | ||
5 | println!(indoc!("Hello {world}")); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: did you intend to capture a variable `world` from the surrounding scope? | ||
= note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro |