-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add some more weird-exprs #86713
Conversation
Add or-pattern syntax in argument position
(rust-highfive has picked a reviewer for you, use r? to override) |
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
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 I also added a function returning itself such that it can be curried infinitely many times. |
Instead of changing the code due to inaccurate code highlighters, wouldn't it be better to file a bug against the highlighters? |
@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). |
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'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 = !((|(..):(_,_),(|__@_|__)|__)((&*"\\",'#')/**/,{})=={&[..=..][..];})// |
There was a problem hiding this comment.
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.
@oberien Ping from triage, any updates here? |
Ping from triage: |
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).
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).
Add or-pattern syntax in argument position to
special_characters
inweird-exprs.rs
.