Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add undocumented Punctuation token Tilde ~ #1149

Merged
merged 2 commits into from
Mar 11, 2022
Merged

Conversation

pushkine
Copy link
Contributor

The token ~ is a valid punctuation token inside macro invocations and macro rule declarations: https://replit.com/@pushkine/Tilde-token#src/main.rs

@ehuss ehuss added the T-lang Team: Lang label Jan 30, 2022
@ehuss
Copy link
Contributor

ehuss commented Jan 30, 2022

Thanks, this has been on my todo list.

Since this is new content that was never explicitly decided upon, I'm going to check with the libs team.

@rust-lang/lang The ~ token has been part of rust since the very early days as part of the old box syntax. It was never removed or feature gated. Since it has been on stable ever since, I think we should include it as a documented token since it can be used in macros. I also believe there is some interest in using it with ~const.

@rfcbot fcp merge

@joshtriplett
Copy link
Member

People can already use it in stable code, so this isn't so much a decision we can make as an acknowledgement of the current state of things; changing that would be a breaking change. Documenting this seems reasonable.

Separately, we might ask whether we can usefully use ~ for some new feature, but that won't remove the ability to use the token in macros.

(As an aside, speaking only for myself and not others on the lang team, I really hope that ~const is not the final syntax for that mechanism; I'd much rather use a different token for that.)

@ehuss
Copy link
Contributor

ehuss commented Jan 30, 2022

Can someone at @rust-lang/lang issue the @rfcbot fcp merge command? I think rfcbot only allows that command for members of that specific team.

@ehuss
Copy link
Contributor

ehuss commented Jan 30, 2022

Yea, I think it should be documented. The reason I wanted to bring it up is:

A. Get awareness of this.
B. An alternative to documenting is to future-incompat sweep it under the rug (since this wasn't ever documented or necessarily intended). I doubt that is worth the hassle.
C. Check on the wording here. I'm not sure if "deprecated" is really the correct term. More like "unused" maybe?

src/tokens.md Outdated Show resolved Hide resolved
@joshtriplett
Copy link
Member

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Jan 30, 2022

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
@scottmcm
Copy link
Member

I agree that trying to change the tokenizing rules here wouldn't be valuable enough to be worth the effort.

@rfcbot
Copy link

rfcbot commented Mar 1, 2022

🔔 This is now entering its final comment period, as per the review above. 🔔

psst @joshtriplett, I wasn't able to add the final-comment-period label, please do so.

@rfcbot
Copy link

rfcbot commented Mar 11, 2022

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

psst @joshtriplett, I wasn't able to add the finished-final-comment-period label, please do so.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss merged commit f74bb08 into rust-lang:master Mar 11, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 16, 2022
Update books

## reference

8 commits in 9d289c05fce7254b99c6a0d354d84abb7fd7a032..0a2fe6651fbccc6416c5110fdf5b93fb3cb29247
2022-02-23 08:58:20 -0800 to 2022-03-15 09:32:25 -0700
- Documentation PR for cfg_panic (rust-lang/reference#1157)
- Document aarch64 `target_feature` options (rust-lang/reference#1102)
- Try to clarify destructor not being run scenario. (rust-lang/reference#1107)
- Add undocumented Punctuation token Tilde `~` (rust-lang/reference#1149)
- update UB list for safe target_feature (rust-lang/reference#1050)
- Update const_eval.md for feature stabilization (rust-lang/reference#1166)
- Remove `.intel_syntax`/`.att_syntax` support entirely.
- Fix `.intel_syntax` directive

## book

3 commits in 3f255ed40b8c82a0434088568fbed270dc31bf00..036e88a4f135365de85358febe5324976a56030a
2022-02-27 21:26:12 -0500 to 2022-03-04 21:53:33 -0500
- Fix some links and small wordings
- Snapshot of chapter 19 for nostarch
- Clarify fully-qualified syntax explanation

## rust-by-example

2 commits in 2a928483a20bb306a7399c0468234db90d89afb5..d504324f1e7dc7edb918ac39baae69f1f1513b8e
2022-02-28 11:36:59 -0300 to 2022-03-07 09:26:32 -0300
- Fixed extra indentation at line 43 in Phantom Testcase example. (rust-lang/rust-by-example#1515)
- Typo fixed in description of inline ASM cpuid function (rust-lang/rust-by-example#1514)

## rustc-dev-guide

3 commits in 32f2a5b4e7545318846185198542230170dd8a42..0e4b961a9c708647bca231430ce1b199993e0196
2022-03-01 10:45:24 -0600 to 2022-03-14 08:40:37 -0700
- update winget install instructions to ensure proper packages are installed (-e for --exact, and full package names to ensure arbitrary packages from
the msstore source aren't installed)
- Add missing rustdoc tests explanations
- Fix incorrectly escaped backtick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Team: Lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants