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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/test/ui/weird-exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

#![feature(generators)]
#![feature(destructuring_assignment)]
#![feature(unboxed_closures, fn_traits)]

#![allow(non_camel_case_types)]
#![allow(dead_code)]
#![allow(unreachable_code)]
#![allow(unused_braces, unused_must_use, unused_parens)]
#![allow(uncommon_codepoints, confusable_idents)]

#![recursion_limit = "256"]

Expand Down Expand Up @@ -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.

;
assert!(!val);
}
Expand Down Expand Up @@ -165,6 +167,24 @@ fn monkey_barrel() {
assert_eq!(val, ());
}

fn unicode() {
fn 𝚋𝚛𝚎𝚊𝚔() -> char { '🤔' }
assert_eq!(loop {
break 𝚋𝚛𝚎𝚊𝚔 ();
}, '🤔');
}

fn function() {
struct foo;
impl FnOnce<()> for foo {
type Output = foo;
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
foo
}
}
let foo = foo () ()() ()()() ()()()() ()()()()();
}

pub fn main() {
strange();
funny();
Expand All @@ -184,4 +204,6 @@ pub fn main() {
i_yield();
match_nested_if();
monkey_barrel();
unicode();
function();
}