Skip to content

Conversation

@illicitonion
Copy link
Contributor

@illicitonion illicitonion commented Aug 13, 2025

Before this change, the suggestion for
Option.or(Some(vec![])).unwrap() expanded the vec! macro which broke the code, both in terms of readability, and because the expansion references $crate which cannot be inlined.

changelog: [or_then_unwrap]: Preserve macro calls rather than expanding them

Relates to #6851

Before this change, the suggestion for
`Option.or(Some(vec![])).unwrap()` expanded the `vec!` macro which broke
the code, both in terms of readability, and because the expansion
references `$crate` which cannot be inlined.
@rustbot
Copy link
Collaborator

rustbot commented Aug 13, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 13, 2025
@illicitonion illicitonion changed the title or_then_unwrap suggestion preserves macro calls fix or_then_unwrap: suggestion preserves macro calls Aug 13, 2025
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

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

Thank you!

@llogiq llogiq added this pull request to the merge queue Aug 24, 2025
Merged via the queue into rust-lang:master with commit 7b611d4 Aug 24, 2025
13 of 15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 24, 2025
@illicitonion illicitonion deleted the or-then-unwrap-macro branch August 24, 2025 09:28
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