Skip to content

Commit

Permalink
Rollup merge of #96433 - petrochenkov:delim, r=nnethercote
Browse files Browse the repository at this point in the history
rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`

Compiler cannot reuse `proc_macro::Delimiter` directly due to extra impls, but can at least use the same naming.

After this PR the only difference between these two enums is that `proc_macro::Delimiter::None` is turned into `token::Delimiter::Invisible`.
It's my mistake that the invisible delimiter is called `None` on stable, during the stabilization I audited the naming and wrote the docs, but missed the fact that the `None` naming gives a wrong and confusing impression about what this thing is.

cc rust-lang/rust#96421
r? ``@nnethercote``
  • Loading branch information
Dylan-DPC committed Apr 28, 2022
2 parents 862bcf4 + 7d05bb1 commit b127237
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ pub enum Delimiter {
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
Bracket,
/// `Ø ... Ø`
/// An implicit delimiter, that may, for example, appear around tokens coming from a
/// An invisible delimiter, that may, for example, appear around tokens coming from a
/// "macro variable" `$var`. It is important to preserve operator priorities in cases like
/// `$var * 3` where `$var` is `1 + 2`.
/// Implicit delimiters might not survive roundtrip of a token stream through a string.
/// Invisible delimiters might not survive roundtrip of a token stream through a string.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
None,
}
Expand Down

0 comments on commit b127237

Please sign in to comment.