Skip to content

fix: complete envs in nested env!()#21902

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:nested-env-macro
Mar 30, 2026
Merged

fix: complete envs in nested env!()#21902
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:nested-env-macro

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

Example

fn main() {
    println!("{}", env!("CA$0"));
}

Before this PR

Cannot complete any env

After this PR

fn main() {
    println!("{}", env!("CARGO_BIN_NAME"));
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2026
Example
---
```rust
fn main() {
    println!("{}", env!("CA$0"));
}
```

**Before this PR**

Cannot complete any env

**After this PR**

```rust
fn main() {
    println!("{}", env!("CARGO_BIN_NAME"));
}
```
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "nested" you mean inside other macros, not inside other env!()s, right?

View changes since this review

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Mar 30, 2026
Merged via the queue into rust-lang:master with commit 1f40aa9 Mar 30, 2026
17 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 30, 2026
@A4-Tacks A4-Tacks deleted the nested-env-macro branch March 31, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants