Files
rust/tests/ui/parser/macro/auxiliary/unicode-control.rs
Matthew Jasper 65bdb31a97 Report text_direction_codepoint_in_literal when parsing
- The lint is now reported in code that gets removed/modified/duplicated
  by macro expansion.
- Spans are more accurate
- Fixes #140281
2025-05-27 15:57:41 +00:00

20 lines
411 B
Rust
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#![allow(text_direction_codepoint_in_literal)]
extern crate proc_macro;
use proc_macro::*;
#[proc_macro]
pub fn create_rtl_in_string(_: TokenStream) -> TokenStream {
r#""test RTL in string literal""#.parse().unwrap()
}
#[proc_macro]
pub fn forward_stream(s: TokenStream) -> TokenStream {
s
}
#[proc_macro]
pub fn recollect_stream(s: TokenStream) -> TokenStream {
s.into_iter().collect()
}