Skip to content

Commit 2368fa2

Browse files
Rollup merge of #112819 - dtolnay:weirdderef, r=Nilstrieb
Disable feature(unboxed_closures, fn_traits) in weird-exprs One shouldn't need a nightly compiler in order to ~~have fun~~ call a function many times.
2 parents 0688182 + 32b98ea commit 2368fa2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/ui/weird-exprs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(generators)]
4-
#![feature(unboxed_closures, fn_traits)]
54

65
#![allow(non_camel_case_types)]
76
#![allow(dead_code)]
@@ -17,6 +16,7 @@
1716
extern crate core;
1817
use std::cell::Cell;
1918
use std::mem::swap;
19+
use std::ops::Deref;
2020

2121
// Just a grab bag of stuff that you wouldn't want to actually write.
2222

@@ -183,10 +183,10 @@ fn 𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎() {
183183

184184
fn function() {
185185
struct foo;
186-
impl FnOnce<()> for foo {
187-
type Output = foo;
188-
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
189-
foo
186+
impl Deref for foo {
187+
type Target = fn() -> Self;
188+
fn deref(&self) -> &Self::Target {
189+
&((|| foo) as _)
190190
}
191191
}
192192
let foo = foo () ()() ()()() ()()()() ()()()()();

0 commit comments

Comments
 (0)