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

By design? <&str as quote::ToTokens>::into_token_stream() produces different output from proc_macro2::TokenStream::from_str() #272

Closed
Houtamelo opened this issue Feb 8, 2024 · 1 comment

Comments

@Houtamelo
Copy link

Example case:
This test does not pass due to panicking in the assertion.

#[test]
fn show_quote_bug() {
	let literal = r#"$player_name == "Alice""#;
	
	let from_quote = quote::ToTokens::into_token_stream(literal).to_string();
	let from_str = proc_macro2::TokenStream::from_str(literal).unwrap().to_string();
	
	assert_eq!(from_quote, from_str);
}
@dtolnay
Copy link
Owner

dtolnay commented Feb 8, 2024

Yes, those are intentionally different operations.

@dtolnay dtolnay closed this as completed Feb 8, 2024
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

No branches or pull requests

2 participants