Skip to content

Commit 1903afc

Browse files
committed
Auto merge of rust-lang#125456 - fmease:rollup-n8608gc, r=fmease
Rollup of 7 pull requests Successful merges: - rust-lang#122382 (Detect unused structs which implement private traits) - rust-lang#124389 (Add a warning to proc_macro::Delimiter::None that rustc currently does not respect it.) - rust-lang#125224 (Migrate `run-make/issue-53964` to `rmake`) - rust-lang#125227 (Migrate `run-make/issue-30063` to `rmake`) - rust-lang#125336 (Add dedicated definition for intrinsics) - rust-lang#125401 (Migrate `run-make/rustdoc-scrape-examples-macros` to `rmake.rs`) - rust-lang#125454 (Improve the doc of query associated_item) r? `@ghost` `@rustbot` modify labels: rollup
2 parents df45c5f + 07f94cb commit 1903afc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

proc_macro/src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,18 @@ pub enum Delimiter {
815815
/// "macro variable" `$var`. It is important to preserve operator priorities in cases like
816816
/// `$var * 3` where `$var` is `1 + 2`.
817817
/// Invisible delimiters might not survive roundtrip of a token stream through a string.
818+
///
819+
/// <div class="warning">
820+
///
821+
/// Note: rustc currently can ignore the grouping of tokens delimited by `None` in the output
822+
/// of a proc_macro. Only `None`-delimited groups created by a macro_rules macro in the input
823+
/// of a proc_macro macro are preserved, and only in very specific circumstances.
824+
/// Any `None`-delimited groups (re)created by a proc_macro will therefore not preserve
825+
/// operator priorities as indicated above. The other `Delimiter` variants should be used
826+
/// instead in this context. This is a rustc bug. For details, see
827+
/// [rust-lang/rust#67062](https://github.com/rust-lang/rust/issues/67062).
828+
///
829+
/// </div>
818830
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
819831
None,
820832
}

0 commit comments

Comments
 (0)