Skip to content

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Feb 25, 2023

Fixes #10148. This will trigger only when generating format strings while accepting weird things in a procedural macro and setting the span to something which is not a string.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2023

r? @Alexendoo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 25, 2023
@Alexendoo
Copy link
Member

Thanks!

We have a nice utility for testing proc macro weirdness, you can add

// aux-build: proc_macro_with_span.rs

#[macro_use]
extern crate proc_macro_with_span;

to tests/ui/format.rs or a similar file, and test it with

with_span!(""something format!(""));

@samueltardieu
Copy link
Member Author

We have a nice utility for testing proc macro weirdness

Nice indeed! I've added a test, without even having to write a proc_macro, confirmed panicking before this patch.

@Alexendoo
Copy link
Member

Great, thanks again!

@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2023

📌 Commit 64775f3 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 25, 2023

⌛ Testing commit 64775f3 with merge 5155119...

@bors
Copy link
Contributor

bors commented Feb 25, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 5155119 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'rustc' panicked at 'EscapeOnlyChar'
4 participants