Skip to content

Commit 06971dc

Browse files
authored
Rollup merge of #97237 - oberien:patch-1, r=Dylan-DPC
Add some more weird-exprs Continuing from #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).
2 parents b7b5475 + 6491eb1 commit 06971dc

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/test/ui/weird-exprs.rs

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// run-pass
22

33
#![feature(generators)]
4+
#![feature(unboxed_closures, fn_traits)]
45

56
#![allow(non_camel_case_types)]
67
#![allow(dead_code)]
78
#![allow(unreachable_code)]
89
#![allow(unused_braces, unused_must_use, unused_parens)]
10+
#![allow(uncommon_codepoints, confusable_idents)]
911

1012
#![recursion_limit = "256"]
1113

@@ -115,7 +117,7 @@ fn union() {
115117
}
116118

117119
fn special_characters() {
118-
let val = !((|(..):(_,_),__@_|__)((&*"\\",'🤔')/**/,{})=={&[..=..][..];})//
120+
let val = !((|(..):(_,_),(|__@_|__)|__)((&*"\\",'🤔')/**/,{})=={&[..=..][..];})//
119121
;
120122
assert!(!val);
121123
}
@@ -164,6 +166,28 @@ fn monkey_barrel() {
164166
assert_eq!(val, ());
165167
}
166168

169+
fn 𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎() {
170+
type 𝚕𝚘𝚘𝚙 = i32;
171+
fn 𝚋𝚛𝚎𝚊𝚔() -> 𝚕𝚘𝚘𝚙 {
172+
let 𝚛𝚎𝚝𝚞𝚛𝚗 = 42;
173+
return 𝚛𝚎𝚝𝚞𝚛𝚗;
174+
}
175+
assert_eq!(loop {
176+
break 𝚋𝚛𝚎𝚊𝚔 ();
177+
}, 42);
178+
}
179+
180+
fn function() {
181+
struct foo;
182+
impl FnOnce<()> for foo {
183+
type Output = foo;
184+
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
185+
foo
186+
}
187+
}
188+
let foo = foo () ()() ()()() ()()()() ()()()()();
189+
}
190+
167191
fn bathroom_stall() {
168192
let mut i = 1;
169193
matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1));
@@ -189,5 +213,7 @@ pub fn main() {
189213
i_yield();
190214
match_nested_if();
191215
monkey_barrel();
216+
𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎();
217+
function();
192218
bathroom_stall();
193219
}

0 commit comments

Comments
 (0)