We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d60aaad + 98ea261 commit f0b6802Copy full SHA for f0b6802
src/lib.rs
@@ -835,10 +835,16 @@ impl Punct {
835
/// The returned `Punct` will have the default span of `Span::call_site()`
836
/// which can be further configured with the `set_span` method below.
837
pub fn new(ch: char, spacing: Spacing) -> Self {
838
- Punct {
839
- ch,
840
- spacing,
841
- span: Span::call_site(),
+ if let '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';'
+ | '<' | '=' | '>' | '?' | '@' | '^' | '|' | '~' = ch
+ {
+ Punct {
842
+ ch,
843
+ spacing,
844
+ span: Span::call_site(),
845
+ }
846
+ } else {
847
+ panic!("unsupported proc macro punctuation character {:?}", ch);
848
}
849
850
0 commit comments