Skip to content

Commit e9aa9d6

Browse files
Add a warning to Delimiter::None that rustc currently does not respect it.
It does not provide the behaviour it is indicated to provide when used in a proc_macro context.
1 parent fd2c998 commit e9aa9d6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,16 @@ pub enum Delimiter {
685685
/// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`.
686686
/// Invisible delimiters may not survive roundtrip of a token stream through
687687
/// a string.
688+
///
689+
/// <div class="warning">
690+
///
691+
/// Note: rustc currently (1.77 and below) ignores the grouping of tokens
692+
/// delimited by `None` in the output of a proc_macro. Thus it will not
693+
/// preserve operator priorities as indicated above. The other `Delimiter`
694+
/// variants should be used instead in this context. For details, see
695+
/// [rust-lang/rust#67062](https://github.com/rust-lang/rust/issues/67062).
696+
///
697+
/// </div>
688698
None,
689699
}
690700

0 commit comments

Comments
 (0)