Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ui test of current behavior of capture in nested macro #60

Merged
merged 1 commit into from Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/ui/capture-var-nested.rs
@@ -0,0 +1,6 @@
use indoc::indoc;

fn main() {
let world = "world";
println!(indoc!("Hello {world}"));
}
8 changes: 8 additions & 0 deletions tests/ui/capture-var-nested.stderr
@@ -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