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 some more weird-exprs #86713

Closed
wants to merge 3 commits into from
Closed

Add some more weird-exprs #86713

wants to merge 3 commits into from

Conversation

oberien
Copy link
Contributor

@oberien oberien commented Jun 29, 2021

Add or-pattern syntax in argument position to special_characters in weird-exprs.rs.

Add or-pattern syntax in argument position
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 29, 2021
@joshtriplett
Copy link
Member

Please don't drop the emoji in the single quotes; that's a test in itself.

Use unicode identifiers and a unicode emoji in weird-exprs.rs
@oberien
Copy link
Contributor Author

oberien commented Jun 29, 2021

I added a different function which contains the emoji. It appears as though the github (and play.rust-lang.org) syntax highlighters don't highlight fn correctly if followed by a unicode identifier.

I also added a function returning itself such that it can be curried infinitely many times.

@oberien oberien changed the title Make the most special expression even more special Add some more weird-exprs Jun 29, 2021
@the8472
Copy link
Member

the8472 commented Jun 29, 2021

It appears as though the github (and play.rust-lang.org) syntax highlighters don't highlight fn correctly if followed by a unicode identifier.

Instead of changing the code due to inaccurate code highlighters, wouldn't it be better to file a bug against the highlighters?

@joshtriplett
Copy link
Member

@the8472 Agreed. The purpose of these expressions is to invoke weird corner cases. Sounds like they found one, in syntax highlighters. That's all the more reason to keep those expressions; they might cause similar bugs in other things.

I would propose that we keep the expression as-is, and add a new weird expression that includes additional components (potentially copying from the existing one if there's an interesting interaction).

@oberien
Copy link
Contributor Author

oberien commented Jun 30, 2021

Oh yeah, I absolutely won't change the code. It is completely valid and working rust code. The syntax highlighting was just something I noticed while working on it. The whole file is just weird expressions to trigger exactly these kinds of problems that most likely won't be found in "normal" crates or projects.

I would propose that we keep the expression as-is, and add a new weird expression that includes additional components (potentially copying from the existing one if there's an interesting interaction).

I'm not sure I understand what you mean. The code in this PR should be finished from my side.

@@ -116,7 +118,7 @@ fn union() {
}

fn special_characters() {
let val = !((|(..):(_,_),__@_|__)((&*"\\",'🤔')/**/,{})=={&[..=..][..];})//
let val = !((|(..):(_,_),(|__@_|__)|__)((&*"\\",'#')/**/,{})=={&[..=..][..];})//
Copy link
Member

@the8472 the8472 Jun 30, 2021

Choose a reason for hiding this comment

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

I would propose that we keep the expression as-is, and add a new weird expression that includes additional components (potentially copying from the existing one if there's an interesting interaction).

I'm not sure I understand what you mean. The code in this PR should be finished from my side.

You're still removing the emoji here.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 1, 2021
@crlf0710
Copy link
Member

@oberien Ping from triage, any updates here?

@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 17, 2021
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 31, 2021
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 15, 2021
@JohnCSimon
Copy link
Member

Ping from triage:
@oberien I'm closing this as inactive, please feel free to reopen when you're ready to continue. Thank you.

@JohnCSimon JohnCSimon closed this Aug 15, 2021
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request May 21, 2022
Add some more weird-exprs

Continuing from rust-lang#86713 (which stalled due to a thinking emoji), I'd like to "improve" the `weird-exprs.rs`-file (as I can't reopen that PR).
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 21, 2022
Add some more weird-exprs

Continuing from rust-lang#86713 (which stalled due to a thinking emoji), I'd like to "improve" the `weird-exprs.rs`-file (as I can't reopen that PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants