diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-06-20 14:23:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-20 14:23:41 +0200 |
| commit | 2368fa27d1e59779fbf4918dbf02778d003da0fa (patch) | |
| tree | 66f84e74978aa892eef80da22e393f378d1de027 | |
| parent | 0688182f9b2508117d8c8f44924c738a108a8bef (diff) | |
| parent | 32b98ea2a9db0337acd8cec62925e2e287f54032 (diff) | |
| download | rust-2368fa27d1e59779fbf4918dbf02778d003da0fa.tar.gz rust-2368fa27d1e59779fbf4918dbf02778d003da0fa.zip | |
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.
| -rw-r--r-- | tests/ui/weird-exprs.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/weird-exprs.rs b/tests/ui/weird-exprs.rs index 59b4bb8ef85..892b281357f 100644 --- a/tests/ui/weird-exprs.rs +++ b/tests/ui/weird-exprs.rs @@ -1,7 +1,6 @@ // run-pass #![feature(generators)] -#![feature(unboxed_closures, fn_traits)] #![allow(non_camel_case_types)] #![allow(dead_code)] @@ -17,6 +16,7 @@ extern crate core; use std::cell::Cell; use std::mem::swap; +use std::ops::Deref; // Just a grab bag of stuff that you wouldn't want to actually write. @@ -183,10 +183,10 @@ fn 𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎() { fn function() { struct foo; - impl FnOnce<()> for foo { - type Output = foo; - extern "rust-call" fn call_once(self, _args: ()) -> Self::Output { - foo + impl Deref for foo { + type Target = fn() -> Self; + fn deref(&self) -> &Self::Target { + &((|| foo) as _) } } let foo = foo () ()() ()()() ()()()() ()()()()(); |
