diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/ui/rfcs/rfc-2396-target_feature-11 | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/rfcs/rfc-2396-target_feature-11')
-rw-r--r-- | tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs | 12 | ||||
-rw-r--r-- | tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr | 21 |
2 files changed, 18 insertions, 15 deletions
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs index 43bda4962..1374ad935 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs @@ -21,14 +21,14 @@ fn call_once(f: impl FnOnce()) { } fn main() { - call(foo); //~ ERROR expected a `Fn<()>` closure, found `fn() {foo}` - call_mut(foo); //~ ERROR expected a `FnMut<()>` closure, found `fn() {foo}` - call_once(foo); //~ ERROR expected a `FnOnce<()>` closure, found `fn() {foo}` + call(foo); //~ ERROR expected a `Fn()` closure, found `fn() {foo}` + call_mut(foo); //~ ERROR expected a `FnMut()` closure, found `fn() {foo}` + call_once(foo); //~ ERROR expected a `FnOnce()` closure, found `fn() {foo}` call(foo_unsafe); - //~^ ERROR expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` call_mut(foo_unsafe); - //~^ ERROR expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` call_once(foo_unsafe); - //~^ ERROR expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` } diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr index fc7bf2277..100f20482 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}` +error[E0277]: expected a `Fn()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:24:10 | LL | call(foo); - | ---- ^^^ expected an `Fn<()>` closure, found `fn() {foo}` + | ---- ^^^ expected an `Fn()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -15,11 +15,11 @@ note: required by a bound in `call` LL | fn call(f: impl Fn()) { | ^^^^ required by this bound in `call` -error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}` +error[E0277]: expected a `FnMut()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:25:14 | LL | call_mut(foo); - | -------- ^^^ expected an `FnMut<()>` closure, found `fn() {foo}` + | -------- ^^^ expected an `FnMut()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -32,11 +32,11 @@ note: required by a bound in `call_mut` LL | fn call_mut(f: impl FnMut()) { | ^^^^^^^ required by this bound in `call_mut` -error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}` +error[E0277]: expected a `FnOnce()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:26:15 | LL | call_once(foo); - | --------- ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}` + | --------- ^^^ expected an `FnOnce()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -49,7 +49,7 @@ note: required by a bound in `call_once` LL | fn call_once(f: impl FnOnce()) { | ^^^^^^^^ required by this bound in `call_once` -error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:28:10 | LL | call(foo_unsafe); @@ -58,6 +58,7 @@ LL | call(foo_unsafe); | required by a bound introduced by this call | = help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` + = note: unsafe function cannot be called generically without an unsafe block = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call` @@ -66,7 +67,7 @@ note: required by a bound in `call` LL | fn call(f: impl Fn()) { | ^^^^ required by this bound in `call` -error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:30:14 | LL | call_mut(foo_unsafe); @@ -75,6 +76,7 @@ LL | call_mut(foo_unsafe); | required by a bound introduced by this call | = help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` + = note: unsafe function cannot be called generically without an unsafe block = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call_mut` @@ -83,7 +85,7 @@ note: required by a bound in `call_mut` LL | fn call_mut(f: impl FnMut()) { | ^^^^^^^ required by this bound in `call_mut` -error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:32:15 | LL | call_once(foo_unsafe); @@ -92,6 +94,7 @@ LL | call_once(foo_unsafe); | required by a bound introduced by this call | = help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}` + = note: unsafe function cannot be called generically without an unsafe block = note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }` = note: `#[target_feature]` functions do not implement the `Fn` traits note: required by a bound in `call_once` |