| author | bors <bors@rust-lang.org> 2026-06-28 15:52:45 UTC |
| committer | bors <bors@rust-lang.org> 2026-06-28 15:52:45 UTC |
| log | 2574810b228d53518cc2a13f2ee473195932a999 |
| tree | bbc79ce2af951a45bba0dbd2ae12b732e7994b19 |
| parent | b4486cacf58926f02e451d96e71e20882faf5453 |
| parent | 412fd6b75bf1b15209af52a5ae865f91081ce4a4 |
Rollup of 4 pull requests
Successful merges:
- rust-lang/rust#158486 (std: treat ENFILE as transient in the pidfd support probe)
- rust-lang/rust#158454 (regression test for `Trait<A><B>` in "consider further restricting this bound" suggestion)
- rust-lang/rust#158518 (Fix mixed use of "a" / "an" article in E0277)
- rust-lang/rust#158519 (add crashtests [2/N])88 files changed, 330 insertions(+), 128 deletions(-)
library/core/src/ops/function.rs+3-3| ... | ... | @@ -67,7 +67,7 @@ use crate::marker::Tuple; |
| 67 | 67 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string |
| 68 | 68 | label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
| 69 | 69 | ), |
| 70 | message = "expected a `{This:resolved}` closure, found `{Self}`", | |
| 70 | message = "expected an `{This:resolved}` closure, found `{Self}`", | |
| 71 | 71 | label = "expected an `{This:resolved}` closure, found `{Self}`" |
| 72 | 72 | )] |
| 73 | 73 | #[fundamental] // so that regex can rely that `&str: !FnMut` |
| ... | ... | @@ -154,7 +154,7 @@ pub const trait Fn<Args: Tuple>: [const] FnMut<Args> { |
| 154 | 154 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string |
| 155 | 155 | label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
| 156 | 156 | ), |
| 157 | message = "expected a `{This:resolved}` closure, found `{Self}`", | |
| 157 | message = "expected an `{This:resolved}` closure, found `{Self}`", | |
| 158 | 158 | label = "expected an `{This:resolved}` closure, found `{Self}`" |
| 159 | 159 | )] |
| 160 | 160 | #[fundamental] // so that regex can rely that `&str: !FnMut` |
| ... | ... | @@ -233,7 +233,7 @@ pub const trait FnMut<Args: Tuple>: FnOnce<Args> { |
| 233 | 233 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string |
| 234 | 234 | label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
| 235 | 235 | ), |
| 236 | message = "expected a `{This:resolved}` closure, found `{Self}`", | |
| 236 | message = "expected an `{This:resolved}` closure, found `{Self}`", | |
| 237 | 237 | label = "expected an `{This:resolved}` closure, found `{Self}`" |
| 238 | 238 | )] |
| 239 | 239 | #[fundamental] // so that regex can rely that `&str: !FnMut` |
library/std/src/sys/process/unix/unix.rs+2-2| ... | ... | @@ -510,8 +510,8 @@ impl Command { |
| 510 | 510 | support = SPAWN; |
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | Err(e) if e.raw_os_error() == Some(libc::EMFILE) => { | |
| 514 | // We're temporarily(?) out of file descriptors. In this case pidfd_spawnp would also fail | |
| 513 | Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE | libc::ENOMEM)) => { | |
| 514 | // We're temporarily(?) out of file descriptors or memory. In this case pidfd_spawnp would also fail | |
| 515 | 515 | // Don't update the support flag so we can probe again later. |
| 516 | 516 | return Err(e) |
| 517 | 517 | } |
tests/crashes/149748.rs created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | //@ known-bug: #149748 | |
| 2 | //@ edition: 2024 | |
| 3 | //@ compile-flags: -Zmir-enable-passes=+Inline -Zmir-enable-passes=+ReferencePropagation -Zlint-mir | |
| 4 | ||
| 5 | #![feature(gen_blocks)] | |
| 6 | gen fn foo(z: i32) -> i32 { | |
| 7 | yield z; | |
| 8 | z; | |
| 9 | } | |
| 10 | pub fn main() { | |
| 11 | let mut iter = foo(3); | |
| 12 | assert_eq!(iter.next(), Some(3)) | |
| 13 | } |
tests/crashes/150040.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | //@ known-bug: #150040 | |
| 2 | ||
| 3 | fn main() { | |
| 4 | let [(ref a, b), x]; | |
| 5 | a = ""; | |
| 6 | b = 5; | |
| 7 | } |
tests/crashes/150049.rs created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | //@ known-bug: #150049 | |
| 2 | #![feature(min_generic_const_args)] | |
| 3 | #![feature(inherent_associated_types)] | |
| 4 | struct Foo<'a> { | |
| 5 | x: &'a (), | |
| 6 | } | |
| 7 | ||
| 8 | impl<'a> Foo<'a> { | |
| 9 | fn foo(_: [u8; Foo::X]) { std::mem::transmute([4]) } | |
| 10 | } | |
| 11 | ||
| 12 | fn main() {} |
tests/crashes/150128.rs created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | //@ known-bug: #150128 | |
| 2 | fn main() { | |
| 3 | match 0 { | |
| 4 | _ => || (), | |
| 5 | _ => || (), | |
| 6 | _ => (|| ()) as unsafe fn, | |
| 7 | }; | |
| 8 | } |
tests/crashes/150296.rs created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | //@ known-bug: #150296 | |
| 2 | #[derive(PartialEq)] | |
| 3 | pub struct Thing<const N: usize>; | |
| 4 | ||
| 5 | impl<const N: usize> Thing<N> { | |
| 6 | const A: Self = Thing; | |
| 7 | } | |
| 8 | ||
| 9 | fn broken<const N: usize>(x: Thing<N>) { | |
| 10 | match x { | |
| 11 | <Thing<N>>::A => {} | |
| 12 | _ => {} | |
| 13 | } | |
| 14 | } |
tests/crashes/150387.rs created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | //@ known-bug: #150387 | |
| 2 | #![feature(min_specialization)] | |
| 3 | #![allow(dead_code)] | |
| 4 | ||
| 5 | struct Thing<T>(T) where [T]: Sized; | |
| 6 | ||
| 7 | impl<T> Drop for Thing<T> where [T]: Sized { | |
| 8 | default fn drop(&mut self) {} | |
| 9 | } | |
| 10 | impl<T> Drop for Thing<T> where [T]: Sized { | |
| 11 | fn drop(&mut self) {} | |
| 12 | } | |
| 13 | fn main() {} |
tests/crashes/150403.rs created+26| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | //@ known-bug: #150403 | |
| 2 | #![feature(non_lifetime_binders)] | |
| 3 | ||
| 4 | trait A { | |
| 5 | type GAT<T>: A; | |
| 6 | fn foo<T>(self, t: T) -> Self::GAT<T> | |
| 7 | where | |
| 8 | Self: Sized; | |
| 9 | } | |
| 10 | ||
| 11 | trait B: A where | |
| 12 | for<T> Self::GAT<T>: B, | |
| 13 | { | |
| 14 | fn bar<T>(self) -> Self::GAT<T> | |
| 15 | where | |
| 16 | Self: Sized; | |
| 17 | ||
| 18 | fn baz<T>(self, t: T) -> Self::GAT<T> | |
| 19 | where | |
| 20 | Self: Sized, | |
| 21 | { | |
| 22 | self.foo(t).bar() | |
| 23 | } | |
| 24 | } | |
| 25 | ||
| 26 | fn main() {} |
tests/crashes/150517.rs created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | //@ known-bug: #150517 | |
| 2 | trait Stream { | |
| 3 | type Item; | |
| 4 | fn next(self) -> (); | |
| 5 | } | |
| 6 | impl Stream for &'a () {} | |
| 7 | impl<'a, A> Stream for <&A as Stream>::Item {} | |
| 8 | trait StreamExt { | |
| 9 | fn f(self) -> () | |
| 10 | where | |
| 11 | for<'b> &'b A: Stream, | |
| 12 | { | |
| 13 | self.next() | |
| 14 | } | |
| 15 | } |
tests/crashes/150545.rs created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | //@ known-bug: #150545 | |
| 2 | #![feature(non_lifetime_binders)] | |
| 3 | trait Foo: for<T> Bar<T> { | |
| 4 | type Item; | |
| 5 | fn next(self) -> Self::Item; | |
| 6 | } | |
| 7 | trait Bar<T> {} | |
| 8 | fn main() {} |
tests/crashes/150749.rs created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | //@ known-bug: #150749 | |
| 2 | #![feature(min_generic_const_args)] | |
| 3 | ||
| 4 | trait CollectArray { | |
| 5 | fn inner_array(); | |
| 6 | } | |
| 7 | impl CollectArray for () { | |
| 8 | fn inner_array() { | |
| 9 | let temp_ptr: [(); Self]; | |
| 10 | } | |
| 11 | } | |
| 12 | fn main() {} |
tests/crashes/150969.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | //@ known-bug: #150969 | |
| 2 | #![feature(generic_const_exprs)] | |
| 3 | #![feature(min_generic_const_args)] | |
| 4 | ||
| 5 | fn pass_enum<const N : usize, const M : usize = const {N}> { | |
| 6 | pass_enum::<{None}> | |
| 7 | } |
tests/crashes/151069.rs created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | //@ known-bug: #151069 | |
| 2 | trait Trait { | |
| 3 | type Assoc2; | |
| 4 | } | |
| 5 | struct Bar; | |
| 6 | impl Trait for Bar | |
| 7 | where | |
| 8 | <Bar as Trait>::Assoc2: Trait, | |
| 9 | { | |
| 10 | type Assoc2 = (); | |
| 11 | } | |
| 12 | struct Foo { | |
| 13 | field: <Bar as Trait>::Assoc2, | |
| 14 | } | |
| 15 | static FOO2: &Foo = 0; | |
| 16 | fn main() {} |
tests/ui/abi/bad-custom.rs+1-1| ... | ... | @@ -100,7 +100,7 @@ async unsafe extern "custom" fn no_async_fn() { |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | fn no_promotion_to_fn_trait(f: unsafe extern "custom" fn()) -> impl Fn() { |
| 103 | //~^ ERROR expected a `Fn()` closure, found `unsafe extern "custom" fn()` | |
| 103 | //~^ ERROR expected an `Fn()` closure, found `unsafe extern "custom" fn()` | |
| 104 | 104 | f |
| 105 | 105 | } |
| 106 | 106 |
tests/ui/abi/bad-custom.stderr+1-1| ... | ... | @@ -184,7 +184,7 @@ LL + #[unsafe(naked)] |
| 184 | 184 | LL | async unsafe extern "custom" fn no_async_fn() { |
| 185 | 185 | | |
| 186 | 186 | |
| 187 | error[E0277]: expected a `Fn()` closure, found `unsafe extern "custom" fn()` | |
| 187 | error[E0277]: expected an `Fn()` closure, found `unsafe extern "custom" fn()` | |
| 188 | 188 | --> $DIR/bad-custom.rs:102:64 |
| 189 | 189 | | |
| 190 | 190 | LL | fn no_promotion_to_fn_trait(f: unsafe extern "custom" fn()) -> impl Fn() { |
tests/ui/associated-types/normalization-ice-issue-149746.rs+4-4| ... | ... | @@ -4,14 +4,14 @@ trait Owner { type Ty<T: FnMut()>; } |
| 4 | 4 | impl Owner for () { type Ty<T: FnMut()> = T; } |
| 5 | 5 | pub struct Warns<T> { |
| 6 | 6 | _significant_drop: <() as Owner>::Ty<T>, |
| 7 | //~^ ERROR expected a `FnMut()` closure, found `T` | |
| 7 | //~^ ERROR expected an `FnMut()` closure, found `T` | |
| 8 | 8 | field: String, |
| 9 | 9 | } |
| 10 | 10 | pub fn test<T>(w: Warns<T>) { |
| 11 | //~^ ERROR expected a `FnMut()` closure, found `T` | |
| 11 | //~^ ERROR expected an `FnMut()` closure, found `T` | |
| 12 | 12 | _ = || w.field |
| 13 | //~^ ERROR expected a `FnMut()` closure, found `T` | |
| 14 | //~| ERROR expected a `FnMut()` closure, found `T` | |
| 13 | //~^ ERROR expected an `FnMut()` closure, found `T` | |
| 14 | //~| ERROR expected an `FnMut()` closure, found `T` | |
| 15 | 15 | //~| WARN: changes to closure capture in Rust 2021 will affect drop order |
| 16 | 16 | } |
| 17 | 17 | fn main() {} |
tests/ui/associated-types/normalization-ice-issue-149746.stderr+4-4| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnMut()` closure, found `T` | |
| 1 | error[E0277]: expected an `FnMut()` closure, found `T` | |
| 2 | 2 | --> $DIR/normalization-ice-issue-149746.rs:6:24 |
| 3 | 3 | | |
| 4 | 4 | LL | _significant_drop: <() as Owner>::Ty<T>, |
| ... | ... | @@ -35,7 +35,7 @@ help: add a dummy let to cause `w` to be fully captured |
| 35 | 35 | LL | _ = || { let _ = &w; w.field } |
| 36 | 36 | | +++++++++++++ + |
| 37 | 37 | |
| 38 | error[E0277]: expected a `FnMut()` closure, found `T` | |
| 38 | error[E0277]: expected an `FnMut()` closure, found `T` | |
| 39 | 39 | --> $DIR/normalization-ice-issue-149746.rs:12:9 |
| 40 | 40 | | |
| 41 | 41 | LL | _ = || w.field |
| ... | ... | @@ -48,7 +48,7 @@ note: required by a bound in `Owner::Ty` |
| 48 | 48 | LL | trait Owner { type Ty<T: FnMut()>; } |
| 49 | 49 | | ^^^^^^^ required by this bound in `Owner::Ty` |
| 50 | 50 | |
| 51 | error[E0277]: expected a `FnMut()` closure, found `T` | |
| 51 | error[E0277]: expected an `FnMut()` closure, found `T` | |
| 52 | 52 | --> $DIR/normalization-ice-issue-149746.rs:10:16 |
| 53 | 53 | | |
| 54 | 54 | LL | pub fn test<T>(w: Warns<T>) { |
| ... | ... | @@ -61,7 +61,7 @@ note: required by a bound in `Owner::Ty` |
| 61 | 61 | LL | trait Owner { type Ty<T: FnMut()>; } |
| 62 | 62 | | ^^^^^^^ required by this bound in `Owner::Ty` |
| 63 | 63 | |
| 64 | error[E0277]: expected a `FnMut()` closure, found `T` | |
| 64 | error[E0277]: expected an `FnMut()` closure, found `T` | |
| 65 | 65 | --> $DIR/normalization-ice-issue-149746.rs:12:9 |
| 66 | 66 | | |
| 67 | 67 | LL | _ = || w.field |
tests/ui/async-await/async-fn/impl-header.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ impl async Fn<()> for F {} |
| 6 | 6 | //~^ ERROR `async` trait implementations are unsupported |
| 7 | 7 | //~| ERROR the precise format of `Fn`-family traits' type parameters is subject to change |
| 8 | 8 | //~| ERROR manual implementations of `Fn` are experimental |
| 9 | //~| ERROR expected a `FnMut()` closure, found `F` | |
| 9 | //~| ERROR expected an `FnMut()` closure, found `F` | |
| 10 | 10 | //~| ERROR not all trait items implemented, missing: `call` |
| 11 | 11 | |
| 12 | 12 | fn main() {} |
tests/ui/async-await/async-fn/impl-header.stderr+1-1| ... | ... | @@ -30,7 +30,7 @@ LL | impl async Fn<()> for F {} |
| 30 | 30 | | |
| 31 | 31 | = help: implement the missing item: `fn call(&self, _: ()) -> <Self as FnOnce<()>>::Output { todo!() }` |
| 32 | 32 | |
| 33 | error[E0277]: expected a `FnMut()` closure, found `F` | |
| 33 | error[E0277]: expected an `FnMut()` closure, found `F` | |
| 34 | 34 | --> $DIR/impl-header.rs:5:23 |
| 35 | 35 | | |
| 36 | 36 | LL | impl async Fn<()> for F {} |
tests/ui/cast/raw-ptr-to-dyn-fn-raw-ptr.rs+1-1| ... | ... | @@ -4,6 +4,6 @@ fn main() { |
| 4 | 4 | let ptr: *mut () = core::ptr::null_mut(); |
| 5 | 5 | let _: &mut dyn Fn() = unsafe { |
| 6 | 6 | &mut *(ptr as *mut dyn Fn()) |
| 7 | //~^ ERROR expected a `Fn()` closure, found `()` | |
| 7 | //~^ ERROR expected an `Fn()` closure, found `()` | |
| 8 | 8 | }; |
| 9 | 9 | } |
tests/ui/cast/raw-ptr-to-dyn-fn-raw-ptr.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `()` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `()` | |
| 2 | 2 | --> $DIR/raw-ptr-to-dyn-fn-raw-ptr.rs:6:16 |
| 3 | 3 | | |
| 4 | 4 | LL | &mut *(ptr as *mut dyn Fn()) |
tests/ui/closures/closure-expected.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let x = Some(1); |
| 3 | 3 | let y = x.or_else(4); |
| 4 | //~^ ERROR expected a `FnOnce()` closure, found `{integer}` | |
| 4 | //~^ ERROR expected an `FnOnce()` closure, found `{integer}` | |
| 5 | 5 | } |
tests/ui/closures/closure-expected.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce()` closure, found `{integer}` | |
| 1 | error[E0277]: expected an `FnOnce()` closure, found `{integer}` | |
| 2 | 2 | --> $DIR/closure-expected.rs:3:23 |
| 3 | 3 | | |
| 4 | 4 | LL | let y = x.or_else(4); |
tests/ui/closures/coerce-unsafe-to-closure.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce(&str)` closure, found `unsafe fn(_) -> _ {std::intrinsics::transmute::<_, _>}` | |
| 1 | error[E0277]: expected an `FnOnce(&str)` closure, found `unsafe fn(_) -> _ {std::intrinsics::transmute::<_, _>}` | |
| 2 | 2 | --> $DIR/coerce-unsafe-to-closure.rs:2:44 |
| 3 | 3 | | |
| 4 | 4 | LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); |
tests/ui/contracts/empty-ensures.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ extern crate core; |
| 6 | 6 | use core::contracts::ensures; |
| 7 | 7 | |
| 8 | 8 | #[ensures()] |
| 9 | //~^ ERROR expected a `Fn(&_)` closure, found `()` [E0277] | |
| 9 | //~^ ERROR expected an `Fn(&_)` closure, found `()` [E0277] | |
| 10 | 10 | fn foo(x: u32) -> u32 { |
| 11 | 11 | x * 2 |
| 12 | 12 | } |
tests/ui/contracts/empty-ensures.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(&_)` closure, found `()` | |
| 1 | error[E0277]: expected an `Fn(&_)` closure, found `()` | |
| 2 | 2 | --> $DIR/empty-ensures.rs:8:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #[ensures()] |
tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let number = 2; |
| 3 | Some(true).filter({ //~ ERROR expected a `FnOnce(&bool)` closure, found `bool` | |
| 3 | Some(true).filter({ //~ ERROR expected an `FnOnce(&bool)` closure, found `bool` | |
| 4 | 4 | if number % 2 == 0 { |
| 5 | 5 | number == 0 |
| 6 | 6 | } else { |
tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce(&bool)` closure, found `bool` | |
| 1 | error[E0277]: expected an `FnOnce(&bool)` closure, found `bool` | |
| 2 | 2 | --> $DIR/block_instead_of_closure_in_arg.rs:3:23 |
| 3 | 3 | | |
| 4 | 4 | LL | Some(true).filter({ |
tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const x: usize =42; |
| 2 | 2 | fn main() { |
| 3 | let p = Some(45).and_then({|x| //~ ERROR expected a `FnOnce({integer})` closure, found `Option<usize>` | |
| 3 | let p = Some(45).and_then({|x| //~ ERROR expected an `FnOnce({integer})` closure, found `Option<usize>` | |
| 4 | 4 | 1 + 1; |
| 5 | 5 | Some(x * 2) |
| 6 | 6 | }); |
tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce({integer})` closure, found `Option<usize>` | |
| 1 | error[E0277]: expected an `FnOnce({integer})` closure, found `Option<usize>` | |
| 2 | 2 | --> $DIR/ruby_style_closure_successful_parse.rs:3:31 |
| 3 | 3 | | |
| 4 | 4 | LL | let p = Some(45).and_then({|x| |
tests/ui/extern/extern-wrong-value-type.rs+1-1| ... | ... | @@ -7,5 +7,5 @@ fn main() { |
| 7 | 7 | // extern functions are extern "C" fn |
| 8 | 8 | let _x: extern "C" fn() = f; // OK |
| 9 | 9 | is_fn(f); |
| 10 | //~^ ERROR expected a `Fn()` closure, found `extern "C" fn() {f}` | |
| 10 | //~^ ERROR expected an `Fn()` closure, found `extern "C" fn() {f}` | |
| 11 | 11 | } |
tests/ui/extern/extern-wrong-value-type.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `extern "C" fn() {f}` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `extern "C" fn() {f}` | |
| 2 | 2 | --> $DIR/extern-wrong-value-type.rs:9:11 |
| 3 | 3 | | |
| 4 | 4 | LL | is_fn(f); |
tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs+2-2| ... | ... | @@ -9,7 +9,7 @@ struct Foo; |
| 9 | 9 | impl Fn<()> for Foo { |
| 10 | 10 | //~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change |
| 11 | 11 | //~| ERROR manual implementations of `Fn` are experimental |
| 12 | //~| ERROR expected a `FnMut()` closure, found `Foo` | |
| 12 | //~| ERROR expected an `FnMut()` closure, found `Foo` | |
| 13 | 13 | extern "rust-call" fn call(self, args: ()) -> () {} |
| 14 | 14 | //~^ ERROR "rust-call" ABI is experimental and subject to change |
| 15 | 15 | //~| ERROR `call` has an incompatible type for trait |
| ... | ... | @@ -26,7 +26,7 @@ struct Bar; |
| 26 | 26 | impl FnMut<()> for Bar { |
| 27 | 27 | //~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change |
| 28 | 28 | //~| ERROR manual implementations of `FnMut` are experimental |
| 29 | //~| ERROR expected a `FnOnce()` closure, found `Bar` | |
| 29 | //~| ERROR expected an `FnOnce()` closure, found `Bar` | |
| 30 | 30 | extern "rust-call" fn call_mut(&self, args: ()) -> () {} |
| 31 | 31 | //~^ ERROR "rust-call" ABI is experimental and subject to change |
| 32 | 32 | //~| ERROR incompatible type for trait |
tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr+2-2| ... | ... | @@ -87,7 +87,7 @@ LL | impl FnMut<()> for Bar { |
| 87 | 87 | | |
| 88 | 88 | = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable |
| 89 | 89 | |
| 90 | error[E0277]: expected a `FnMut()` closure, found `Foo` | |
| 90 | error[E0277]: expected an `FnMut()` closure, found `Foo` | |
| 91 | 91 | --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:9:17 |
| 92 | 92 | | |
| 93 | 93 | LL | impl Fn<()> for Foo { |
| ... | ... | @@ -161,7 +161,7 @@ help: change the self-receiver type to match the trait |
| 161 | 161 | LL | extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} |
| 162 | 162 | | +++ |
| 163 | 163 | |
| 164 | error[E0277]: expected a `FnOnce()` closure, found `Bar` | |
| 164 | error[E0277]: expected an `FnOnce()` closure, found `Bar` | |
| 165 | 165 | --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:26:20 |
| 166 | 166 | | |
| 167 | 167 | LL | impl FnMut<()> for Bar { |
tests/ui/fn/fn-trait-formatting.rs+1-1| ... | ... | @@ -17,5 +17,5 @@ fn main() { |
| 17 | 17 | //~| NOTE found struct `Box<dyn FnMut() -> isize>` |
| 18 | 18 | |
| 19 | 19 | needs_fn(1); |
| 20 | //~^ ERROR expected a `Fn(isize)` closure, found `{integer}` | |
| 20 | //~^ ERROR expected an `Fn(isize)` closure, found `{integer}` | |
| 21 | 21 | } |
tests/ui/fn/fn-trait-formatting.stderr+1-1| ... | ... | @@ -39,7 +39,7 @@ LL | let _: () = Box::new(|| -> isize { unimplemented!() }) as Box<dyn FnMut |
| 39 | 39 | = note: expected unit type `()` |
| 40 | 40 | found struct `Box<dyn FnMut() -> isize>` |
| 41 | 41 | |
| 42 | error[E0277]: expected a `Fn(isize)` closure, found `{integer}` | |
| 42 | error[E0277]: expected an `Fn(isize)` closure, found `{integer}` | |
| 43 | 43 | --> $DIR/fn-trait-formatting.rs:19:14 |
| 44 | 44 | | |
| 45 | 45 | LL | needs_fn(1); |
tests/ui/fn/issue-39259.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ struct S; |
| 5 | 5 | |
| 6 | 6 | impl Fn(u32) -> u32 for S { |
| 7 | 7 | //~^ ERROR associated item constraints are not allowed here [E0229] |
| 8 | //~| ERROR expected a `FnMut(u32)` closure, found `S` | |
| 8 | //~| ERROR expected an `FnMut(u32)` closure, found `S` | |
| 9 | 9 | fn call(&self) -> u32 { |
| 10 | 10 | //~^ ERROR method `call` has 1 parameter but the declaration in trait `call` has 2 |
| 11 | 11 | 5 |
tests/ui/fn/issue-39259.stderr+1-1| ... | ... | @@ -22,7 +22,7 @@ help: add the missing parameter from the trait |
| 22 | 22 | LL | fn call(&self, args: Args) -> u32 { |
| 23 | 23 | | ++++++++++++ |
| 24 | 24 | |
| 25 | error[E0277]: expected a `FnMut(u32)` closure, found `S` | |
| 25 | error[E0277]: expected an `FnMut(u32)` closure, found `S` | |
| 26 | 26 | --> $DIR/issue-39259.rs:6:25 |
| 27 | 27 | | |
| 28 | 28 | LL | impl Fn(u32) -> u32 for S { |
tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ trait Fun { |
| 10 | 10 | |
| 11 | 11 | impl<T> Fun for T { |
| 12 | 12 | type F<'a> = Self; |
| 13 | //~^ ERROR expected a `Fn()` closure, found `T` | |
| 13 | //~^ ERROR expected an `Fn()` closure, found `T` | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | fn main() { |
tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `T` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `T` | |
| 2 | 2 | --> $DIR/issue-68642-broken-llvm-ir.rs:12:18 |
| 3 | 3 | | |
| 4 | 4 | LL | type F<'a> = Self; |
tests/ui/generic-associated-types/issue-68643-broken-mir.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ trait Fun { |
| 10 | 10 | |
| 11 | 11 | impl<T> Fun for T { |
| 12 | 12 | type F<'a> = Self; |
| 13 | //~^ ERROR expected a `Fn()` closure, found `T` | |
| 13 | //~^ ERROR expected an `Fn()` closure, found `T` | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | pub fn main() { |
tests/ui/generic-associated-types/issue-68643-broken-mir.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `T` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `T` | |
| 2 | 2 | --> $DIR/issue-68643-broken-mir.rs:12:18 |
| 3 | 3 | | |
| 4 | 4 | LL | type F<'a> = Self; |
tests/ui/generic-associated-types/issue-68644-codegen-selection.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ trait Fun { |
| 10 | 10 | |
| 11 | 11 | impl<T> Fun for T { |
| 12 | 12 | type F<'a> = Self; |
| 13 | //~^ ERROR expected a `Fn()` closure, found `T` | |
| 13 | //~^ ERROR expected an `Fn()` closure, found `T` | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | fn main() { |
tests/ui/generic-associated-types/issue-68644-codegen-selection.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `T` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `T` | |
| 2 | 2 | --> $DIR/issue-68644-codegen-selection.rs:12:18 |
| 3 | 3 | | |
| 4 | 4 | LL | type F<'a> = Self; |
tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ trait Fun { |
| 10 | 10 | |
| 11 | 11 | impl<T> Fun for T { |
| 12 | 12 | type F<'a> = Self; |
| 13 | //~^ ERROR expected a `Fn()` closure, found `T` | |
| 13 | //~^ ERROR expected an `Fn()` closure, found `T` | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | fn main() { |
tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `T` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `T` | |
| 2 | 2 | --> $DIR/issue-68645-codegen-fulfillment.rs:12:18 |
| 3 | 3 | | |
| 4 | 4 | LL | type F<'a> = Self; |
tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(<_ as ATC<'a>>::Type)` closure, found `F` | |
| 1 | error[E0277]: expected an `Fn(<_ as ATC<'a>>::Type)` closure, found `F` | |
| 2 | 2 | --> $DIR/issue-62529-3.rs:25:14 |
| 3 | 3 | | |
| 4 | 4 | LL | call(f, ()); |
tests/ui/implied-bounds/issue-100690.rs+1-1| ... | ... | @@ -32,7 +32,7 @@ impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandl |
| 32 | 32 | F: FnOnce(&mut UIView<'a, T>) -> Result<(), io::Error> + Send + 'static, |
| 33 | 33 | { |
| 34 | 34 | real_dispatch(f) |
| 35 | //~^ ERROR expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F` | |
| 35 | //~^ ERROR expected an `FnOnce(&mut UIView<'_, T>)` closure, found `F` | |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 |
tests/ui/implied-bounds/issue-100690.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F` | |
| 1 | error[E0277]: expected an `FnOnce(&mut UIView<'_, T>)` closure, found `F` | |
| 2 | 2 | --> $DIR/issue-100690.rs:34:23 |
| 3 | 3 | | |
| 4 | 4 | LL | real_dispatch(f) |
tests/ui/intrinsics/const-eval-select-bad.rs+2-2| ... | ... | @@ -7,8 +7,8 @@ const fn not_fn_items() { |
| 7 | 7 | const_eval_select((), || {}, || {}); |
| 8 | 8 | //~^ ERROR const FnOnce()` is not satisfied |
| 9 | 9 | const_eval_select((), 42, 0xDEADBEEF); |
| 10 | //~^ ERROR expected a `FnOnce()` closure | |
| 11 | //~| ERROR expected a `FnOnce()` closure | |
| 10 | //~^ ERROR expected an `FnOnce()` closure | |
| 11 | //~| ERROR expected an `FnOnce()` closure | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | const fn foo(n: i32) -> i32 { |
tests/ui/intrinsics/const-eval-select-bad.stderr+2-2| ... | ... | @@ -9,7 +9,7 @@ LL | const_eval_select((), || {}, || {}); |
| 9 | 9 | note: required by a bound in `const_eval_select` |
| 10 | 10 | --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL |
| 11 | 11 | |
| 12 | error[E0277]: expected a `FnOnce()` closure, found `{integer}` | |
| 12 | error[E0277]: expected an `FnOnce()` closure, found `{integer}` | |
| 13 | 13 | --> $DIR/const-eval-select-bad.rs:9:27 |
| 14 | 14 | | |
| 15 | 15 | LL | const_eval_select((), 42, 0xDEADBEEF); |
| ... | ... | @@ -22,7 +22,7 @@ LL | const_eval_select((), 42, 0xDEADBEEF); |
| 22 | 22 | note: required by a bound in `const_eval_select` |
| 23 | 23 | --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL |
| 24 | 24 | |
| 25 | error[E0277]: expected a `FnOnce()` closure, found `{integer}` | |
| 25 | error[E0277]: expected an `FnOnce()` closure, found `{integer}` | |
| 26 | 26 | --> $DIR/const-eval-select-bad.rs:9:31 |
| 27 | 27 | | |
| 28 | 28 | LL | const_eval_select((), 42, 0xDEADBEEF); |
tests/ui/iterators/fold-iterator-error-23966.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnMut(_, char)` closure, found `()` | |
| 1 | error[E0277]: expected an `FnMut(_, char)` closure, found `()` | |
| 2 | 2 | --> $DIR/fold-iterator-error-23966.rs:3:32 |
| 3 | 3 | | |
| 4 | 4 | LL | "".chars().fold(|_, _| (), ()); |
tests/ui/lifetimes/issue-76168-hr-outlives-3.rs+3-3| ... | ... | @@ -4,9 +4,9 @@ |
| 4 | 4 | use std::future::Future; |
| 5 | 5 | |
| 6 | 6 | async fn wrapper<F>(f: F) |
| 7 | //~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 8 | //~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 9 | //~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 7 | //~^ ERROR: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 8 | //~| ERROR: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 9 | //~| ERROR: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 10 | 10 | where |
| 11 | 11 | F:, |
| 12 | 12 | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, |
tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 1 | error[E0277]: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 2 | 2 | --> $DIR/issue-76168-hr-outlives-3.rs:6:1 |
| 3 | 3 | | |
| 4 | 4 | LL | / async fn wrapper<F>(f: F) |
| ... | ... | @@ -9,7 +9,7 @@ LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> |
| 9 | 9 | | |
| 10 | 10 | = help: the trait `for<'a> FnOnce(&'a mut i32)` is not implemented for `i32` |
| 11 | 11 | |
| 12 | error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 12 | error[E0277]: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 13 | 13 | --> $DIR/issue-76168-hr-outlives-3.rs:6:26 |
| 14 | 14 | | |
| 15 | 15 | LL | async fn wrapper<F>(f: F) |
| ... | ... | @@ -17,7 +17,7 @@ LL | async fn wrapper<F>(f: F) |
| 17 | 17 | | |
| 18 | 18 | = help: the trait `for<'a> FnOnce(&'a mut i32)` is not implemented for `i32` |
| 19 | 19 | |
| 20 | error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` | |
| 20 | error[E0277]: expected an `FnOnce(&'a mut i32)` closure, found `i32` | |
| 21 | 21 | --> $DIR/issue-76168-hr-outlives-3.rs:6:26 |
| 22 | 22 | | |
| 23 | 23 | LL | async fn wrapper<F>(f: F) |
tests/ui/lifetimes/issue-95023.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ impl Fn(&isize) for Error { |
| 4 | 4 | //~^ ERROR manual implementations of `Fn` are experimental [E0183] |
| 5 | 5 | //~| ERROR associated item constraints are not allowed here [E0229] |
| 6 | 6 | //~| ERROR not all trait items implemented |
| 7 | //~| ERROR expected a `FnMut(&isize)` closure, found `Error` | |
| 7 | //~| ERROR expected an `FnMut(&isize)` closure, found `Error` | |
| 8 | 8 | fn foo<const N: usize>(&self) -> Self::B<{ N }>; |
| 9 | 9 | //~^ ERROR associated function in `impl` without body |
| 10 | 10 | //~| ERROR method `foo` is not a member of trait `Fn` [E0407] |
tests/ui/lifetimes/issue-95023.stderr+1-1| ... | ... | @@ -40,7 +40,7 @@ LL | impl Fn(&isize) for Error { |
| 40 | 40 | | |
| 41 | 41 | = help: implement the missing item: `fn call(&self, _: (&isize,)) -> <Self as FnOnce<(&isize,)>>::Output { todo!() }` |
| 42 | 42 | |
| 43 | error[E0277]: expected a `FnMut(&isize)` closure, found `Error` | |
| 43 | error[E0277]: expected an `FnMut(&isize)` closure, found `Error` | |
| 44 | 44 | --> $DIR/issue-95023.rs:3:21 |
| 45 | 45 | | |
| 46 | 46 | LL | impl Fn(&isize) for Error { |
tests/ui/macros/ice-in-tokenstream-for-contracts-issue-140683.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | struct T; |
| 5 | 5 | |
| 6 | 6 | impl T { |
| 7 | #[core::contracts::ensures] //~ ERROR expected a `Fn(&_)` closure, found `()` | |
| 7 | #[core::contracts::ensures] //~ ERROR expected an `Fn(&_)` closure, found `()` | |
| 8 | 8 | fn b() {(loop)} |
| 9 | 9 | //~^ ERROR expected `{`, found `)` |
| 10 | 10 | //~| ERROR expected `{`, found `)` |
tests/ui/macros/ice-in-tokenstream-for-contracts-issue-140683.stderr+1-1| ... | ... | @@ -16,7 +16,7 @@ LL | fn b() {(loop)} |
| 16 | 16 | | |
| 17 | 17 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 18 | 18 | |
| 19 | error[E0277]: expected a `Fn(&_)` closure, found `()` | |
| 19 | error[E0277]: expected an `Fn(&_)` closure, found `()` | |
| 20 | 20 | --> $DIR/ice-in-tokenstream-for-contracts-issue-140683.rs:7:5 |
| 21 | 21 | | |
| 22 | 22 | LL | #[core::contracts::ensures] |
tests/ui/methods/filter-relevant-fn-bounds.rs+1-1| ... | ... | @@ -16,5 +16,5 @@ impl Wrapper { |
| 16 | 16 | fn main() { |
| 17 | 17 | let mut wrapper = Wrapper; |
| 18 | 18 | wrapper.do_something_wrapper(|value| ()); |
| 19 | //~^ ERROR expected a `FnOnce | |
| 19 | //~^ ERROR expected an `FnOnce | |
| 20 | 20 | } |
tests/ui/methods/filter-relevant-fn-bounds.stderr+1-1| ... | ... | @@ -12,7 +12,7 @@ help: consider further restricting type parameter `F` with trait `Output` |
| 12 | 12 | LL | F: for<'a> FnOnce(<F as Output<'a>>::Type) + for<'a> Output<'a>, |
| 13 | 13 | | ++++++++++++++++++++ |
| 14 | 14 | |
| 15 | error[E0277]: expected a `FnOnce(<{closure@$DIR/filter-relevant-fn-bounds.rs:18:34: 18:41} as Output<'a>>::Type)` closure, found `{closure@$DIR/filter-relevant-fn-bounds.rs:18:34: 18:41}` | |
| 15 | error[E0277]: expected an `FnOnce(<{closure@$DIR/filter-relevant-fn-bounds.rs:18:34: 18:41} as Output<'a>>::Type)` closure, found `{closure@$DIR/filter-relevant-fn-bounds.rs:18:34: 18:41}` | |
| 16 | 16 | --> $DIR/filter-relevant-fn-bounds.rs:18:34 |
| 17 | 17 | | |
| 18 | 18 | LL | wrapper.do_something_wrapper(|value| ()); |
tests/ui/methods/method-suggestion-trait-with-extra-generics-no-ice.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ struct Bar; |
| 16 | 16 | |
| 17 | 17 | fn main() { |
| 18 | 18 | let foo: Box<dyn Fn(bool) -> usize> = Box::new(Bar); |
| 19 | //~^ ERROR expected a `Fn(bool)` closure, found `Bar` | |
| 19 | //~^ ERROR expected an `Fn(bool)` closure, found `Bar` | |
| 20 | 20 | foo.borrow(); |
| 21 | 21 | //~^ ERROR no method named `borrow` found |
| 22 | 22 | foo.take() |
tests/ui/methods/method-suggestion-trait-with-extra-generics-no-ice.stderr+1-1| ... | ... | @@ -22,7 +22,7 @@ help: there is a method `borrow_mut` with a similar name |
| 22 | 22 | LL | foo.borrow_mut(); |
| 23 | 23 | | ++++ |
| 24 | 24 | |
| 25 | error[E0277]: expected a `Fn(bool)` closure, found `Bar` | |
| 25 | error[E0277]: expected an `Fn(bool)` closure, found `Bar` | |
| 26 | 26 | --> $DIR/method-suggestion-trait-with-extra-generics-no-ice.rs:18:43 |
| 27 | 27 | | |
| 28 | 28 | LL | let foo: Box<dyn Fn(bool) -> usize> = Box::new(Bar); |
tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.current.fixed+2-2| ... | ... | @@ -5,10 +5,10 @@ |
| 5 | 5 | fn main() { |
| 6 | 6 | let _ = (-10..=10).find(|x: &i32| x.signum() == 0); |
| 7 | 7 | //[current]~^ ERROR type mismatch in closure arguments |
| 8 | //[next]~^^ ERROR: expected a `FnMut(&{integer})` closure, found | |
| 8 | //[next]~^^ ERROR: expected an `FnMut(&{integer})` closure, found | |
| 9 | 9 | //[next]~| ERROR: type mismatch resolving `<{closure@closure-arg-type-mismatch-issue-45727.rs:6:29} as FnOnce<(&{integer},)>>::Output == bool` |
| 10 | 10 | let _ = (-10..=10).find(|x: &i32| x.signum() == 0); |
| 11 | 11 | //[current]~^ ERROR type mismatch in closure arguments |
| 12 | //[next]~^^ ERROR: expected a `FnMut(&{integer})` closure, found | |
| 12 | //[next]~^^ ERROR: expected an `FnMut(&{integer})` closure, found | |
| 13 | 13 | //[next]~| ERROR: type mismatch resolving `<{closure@closure-arg-type-mismatch-issue-45727.rs:10:29} as FnOnce<(&{integer},)>>::Output == bool` |
| 14 | 14 | } |
tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.next.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnMut(&{integer})` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}` | |
| 1 | error[E0277]: expected an `FnMut(&{integer})` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}` | |
| 2 | 2 | --> $DIR/closure-arg-type-mismatch-issue-45727.rs:6:29 |
| 3 | 3 | | |
| 4 | 4 | LL | let _ = (-10..=10).find(|x: i32| x.signum() == 0); |
| ... | ... | @@ -23,7 +23,7 @@ LL | let _ = (-10..=10).find(|x: i32| x.signum() == 0); |
| 23 | 23 | note: required by a bound in `find` |
| 24 | 24 | --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL |
| 25 | 25 | |
| 26 | error[E0277]: expected a `FnMut(&{integer})` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}` | |
| 26 | error[E0277]: expected an `FnMut(&{integer})` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:10:29: 10:40}` | |
| 27 | 27 | --> $DIR/closure-arg-type-mismatch-issue-45727.rs:10:29 |
| 28 | 28 | | |
| 29 | 29 | LL | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0); |
tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs+2-2| ... | ... | @@ -5,10 +5,10 @@ |
| 5 | 5 | fn main() { |
| 6 | 6 | let _ = (-10..=10).find(|x: i32| x.signum() == 0); |
| 7 | 7 | //[current]~^ ERROR type mismatch in closure arguments |
| 8 | //[next]~^^ ERROR: expected a `FnMut(&{integer})` closure, found | |
| 8 | //[next]~^^ ERROR: expected an `FnMut(&{integer})` closure, found | |
| 9 | 9 | //[next]~| ERROR: type mismatch resolving `<{closure@closure-arg-type-mismatch-issue-45727.rs:6:29} as FnOnce<(&{integer},)>>::Output == bool` |
| 10 | 10 | let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0); |
| 11 | 11 | //[current]~^ ERROR type mismatch in closure arguments |
| 12 | //[next]~^^ ERROR: expected a `FnMut(&{integer})` closure, found | |
| 12 | //[next]~^^ ERROR: expected an `FnMut(&{integer})` closure, found | |
| 13 | 13 | //[next]~| ERROR: type mismatch resolving `<{closure@closure-arg-type-mismatch-issue-45727.rs:10:29} as FnOnce<(&{integer},)>>::Output == bool` |
| 14 | 14 | } |
tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs+2-2| ... | ... | @@ -24,9 +24,9 @@ fn main() { |
| 24 | 24 | let _ = produces_string().and_then(takes_str_but_too_many_refs); |
| 25 | 25 | //~^ ERROR type mismatch in function arguments |
| 26 | 26 | let _ = produces_string().and_then(takes_str_but_wrong_abi); |
| 27 | //~^ ERROR expected a `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` | |
| 27 | //~^ ERROR expected an `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` | |
| 28 | 28 | let _ = produces_string().and_then(takes_str_but_unsafe); |
| 29 | //~^ ERROR expected a `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` | |
| 29 | //~^ ERROR expected an `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` | |
| 30 | 30 | let _ = produces_string().and_then(no_args); |
| 31 | 31 | //~^ ERROR function is expected to take 1 argument, but it takes 0 arguments |
| 32 | 32 | let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs); |
tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr+2-2| ... | ... | @@ -18,7 +18,7 @@ help: consider wrapping the function in a closure |
| 18 | 18 | LL | let _ = produces_string().and_then(|arg0: String| takes_str_but_too_many_refs(/* &&str */)); |
| 19 | 19 | | ++++++++++++++ +++++++++++++ |
| 20 | 20 | |
| 21 | error[E0277]: expected a `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` | |
| 21 | error[E0277]: expected an `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` | |
| 22 | 22 | --> $DIR/suggest-option-asderef-unfixable.rs:26:40 |
| 23 | 23 | | |
| 24 | 24 | LL | let _ = produces_string().and_then(takes_str_but_wrong_abi); |
| ... | ... | @@ -30,7 +30,7 @@ LL | let _ = produces_string().and_then(takes_str_but_wrong_abi); |
| 30 | 30 | note: required by a bound in `Option::<T>::and_then` |
| 31 | 31 | --> $SRC_DIR/core/src/option.rs:LL:COL |
| 32 | 32 | |
| 33 | error[E0277]: expected a `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` | |
| 33 | error[E0277]: expected an `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` | |
| 34 | 34 | --> $DIR/suggest-option-asderef-unfixable.rs:28:40 |
| 35 | 35 | | |
| 36 | 36 | LL | let _ = produces_string().and_then(takes_str_but_unsafe); |
tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs+7-7| ... | ... | @@ -26,15 +26,15 @@ fn call_once_i32(f: impl FnOnce(i32)) { |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | fn main() { |
| 29 | call(foo); //~ ERROR expected a `Fn()` closure, found `#[target_features] fn() {foo}` | |
| 30 | call_mut(foo); //~ ERROR expected a `FnMut()` closure, found `#[target_features] fn() {foo}` | |
| 31 | call_once(foo); //~ ERROR expected a `FnOnce()` closure, found `#[target_features] fn() {foo}` | |
| 32 | call_once_i32(bar); //~ ERROR expected a `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}` | |
| 29 | call(foo); //~ ERROR expected an `Fn()` closure, found `#[target_features] fn() {foo}` | |
| 30 | call_mut(foo); //~ ERROR expected an `FnMut()` closure, found `#[target_features] fn() {foo}` | |
| 31 | call_once(foo); //~ ERROR expected an `FnOnce()` closure, found `#[target_features] fn() {foo}` | |
| 32 | call_once_i32(bar); //~ ERROR expected an `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}` | |
| 33 | 33 | |
| 34 | 34 | call(foo_unsafe); |
| 35 | //~^ ERROR expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` | |
| 35 | //~^ ERROR expected an `Fn()` closure, found `unsafe fn() {foo_unsafe}` | |
| 36 | 36 | call_mut(foo_unsafe); |
| 37 | //~^ ERROR expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` | |
| 37 | //~^ ERROR expected an `FnMut()` closure, found `unsafe fn() {foo_unsafe}` | |
| 38 | 38 | call_once(foo_unsafe); |
| 39 | //~^ ERROR expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` | |
| 39 | //~^ ERROR expected an `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` | |
| 40 | 40 | } |
tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr+7-7| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `#[target_features] fn() {foo}` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `#[target_features] fn() {foo}` | |
| 2 | 2 | --> $DIR/fn-traits.rs:29:10 |
| 3 | 3 | | |
| 4 | 4 | LL | call(foo); |
| ... | ... | @@ -16,7 +16,7 @@ note: required by a bound in `call` |
| 16 | 16 | LL | fn call(f: impl Fn()) { |
| 17 | 17 | | ^^^^ required by this bound in `call` |
| 18 | 18 | |
| 19 | error[E0277]: expected a `FnMut()` closure, found `#[target_features] fn() {foo}` | |
| 19 | error[E0277]: expected an `FnMut()` closure, found `#[target_features] fn() {foo}` | |
| 20 | 20 | --> $DIR/fn-traits.rs:30:14 |
| 21 | 21 | | |
| 22 | 22 | LL | call_mut(foo); |
| ... | ... | @@ -34,7 +34,7 @@ note: required by a bound in `call_mut` |
| 34 | 34 | LL | fn call_mut(mut f: impl FnMut()) { |
| 35 | 35 | | ^^^^^^^ required by this bound in `call_mut` |
| 36 | 36 | |
| 37 | error[E0277]: expected a `FnOnce()` closure, found `#[target_features] fn() {foo}` | |
| 37 | error[E0277]: expected an `FnOnce()` closure, found `#[target_features] fn() {foo}` | |
| 38 | 38 | --> $DIR/fn-traits.rs:31:15 |
| 39 | 39 | | |
| 40 | 40 | LL | call_once(foo); |
| ... | ... | @@ -52,7 +52,7 @@ note: required by a bound in `call_once` |
| 52 | 52 | LL | fn call_once(f: impl FnOnce()) { |
| 53 | 53 | | ^^^^^^^^ required by this bound in `call_once` |
| 54 | 54 | |
| 55 | error[E0277]: expected a `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}` | |
| 55 | error[E0277]: expected an `FnOnce(i32)` closure, found `#[target_features] fn(i32) {bar}` | |
| 56 | 56 | --> $DIR/fn-traits.rs:32:19 |
| 57 | 57 | | |
| 58 | 58 | LL | call_once_i32(bar); |
| ... | ... | @@ -69,7 +69,7 @@ note: required by a bound in `call_once_i32` |
| 69 | 69 | LL | fn call_once_i32(f: impl FnOnce(i32)) { |
| 70 | 70 | | ^^^^^^^^^^^ required by this bound in `call_once_i32` |
| 71 | 71 | |
| 72 | error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` | |
| 72 | error[E0277]: expected an `Fn()` closure, found `unsafe fn() {foo_unsafe}` | |
| 73 | 73 | --> $DIR/fn-traits.rs:34:10 |
| 74 | 74 | | |
| 75 | 75 | LL | call(foo_unsafe); |
| ... | ... | @@ -88,7 +88,7 @@ note: required by a bound in `call` |
| 88 | 88 | LL | fn call(f: impl Fn()) { |
| 89 | 89 | | ^^^^ required by this bound in `call` |
| 90 | 90 | |
| 91 | error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` | |
| 91 | error[E0277]: expected an `FnMut()` closure, found `unsafe fn() {foo_unsafe}` | |
| 92 | 92 | --> $DIR/fn-traits.rs:36:14 |
| 93 | 93 | | |
| 94 | 94 | LL | call_mut(foo_unsafe); |
| ... | ... | @@ -107,7 +107,7 @@ note: required by a bound in `call_mut` |
| 107 | 107 | LL | fn call_mut(mut f: impl FnMut()) { |
| 108 | 108 | | ^^^^^^^ required by this bound in `call_mut` |
| 109 | 109 | |
| 110 | error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` | |
| 110 | error[E0277]: expected an `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` | |
| 111 | 111 | --> $DIR/fn-traits.rs:38:15 |
| 112 | 112 | | |
| 113 | 113 | LL | call_once(foo_unsafe); |
tests/ui/suggestions/restrict-bound-already-has-generic-args.rs created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | // Regression test for https://github.com/rust-lang/rust/issues/142803. | |
| 2 | ||
| 3 | trait Pair { | |
| 4 | type Left; | |
| 5 | type Right; | |
| 6 | ||
| 7 | fn split(self) -> (Self::Left, Self::Right); | |
| 8 | } | |
| 9 | ||
| 10 | impl<A, B> Pair for (A, B) { | |
| 11 | type Left = A; | |
| 12 | type Right = B; | |
| 13 | ||
| 14 | fn split(self) -> (Self::Left, Self::Right) { | |
| 15 | self | |
| 16 | } | |
| 17 | } | |
| 18 | ||
| 19 | fn frob<A, B>(pair: impl Pair<Left = A>) -> impl Pair<Left = A, Right = B> { | |
| 20 | //~^ ERROR type mismatch | |
| 21 | //~| HELP consider further restricting this bound | |
| 22 | //~| SUGGESTION , Right = B | |
| 23 | let (left, right) = pair.split(); | |
| 24 | (left, right) | |
| 25 | } | |
| 26 | ||
| 27 | fn main() {} |
tests/ui/suggestions/restrict-bound-already-has-generic-args.stderr created+24| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | error[E0271]: type mismatch resolving `<(A, <impl Pair<Left = A> as Pair>::Right) as Pair>::Right == B` | |
| 2 | --> $DIR/restrict-bound-already-has-generic-args.rs:19:45 | |
| 3 | | | |
| 4 | LL | fn frob<A, B>(pair: impl Pair<Left = A>) -> impl Pair<Left = A, Right = B> { | |
| 5 | | - expected this type parameter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<(A, <impl Pair<Left = A> as Pair>::Right) as Pair>::Right == B` | |
| 6 | ... | |
| 7 | LL | (left, right) | |
| 8 | | ------------- return type was inferred to be `(A, <impl Pair<Left = A> as Pair>::Right)` here | |
| 9 | | | |
| 10 | note: expected this to be `B` | |
| 11 | --> $DIR/restrict-bound-already-has-generic-args.rs:12:18 | |
| 12 | | | |
| 13 | LL | type Right = B; | |
| 14 | | ^ | |
| 15 | = note: expected type parameter `B` | |
| 16 | found associated type `<impl Pair<Left = A> as Pair>::Right` | |
| 17 | help: consider further restricting this bound | |
| 18 | | | |
| 19 | LL | fn frob<A, B>(pair: impl Pair<Left = A, Right = B>) -> impl Pair<Left = A, Right = B> { | |
| 20 | | +++++++++++ | |
| 21 | ||
| 22 | error: aborting due to 1 previous error | |
| 23 | ||
| 24 | For more information about this error, try `rustc --explain E0271`. |
tests/ui/trait-bounds/mismatch-fn-trait.stderr+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut(u32)` | |
| 1 | error[E0277]: expected an `FnMut(i32)` closure, found `impl FnMut(u32)` | |
| 2 | 2 | --> $DIR/mismatch-fn-trait.rs:4:10 |
| 3 | 3 | | |
| 4 | 4 | LL | take(f) |
| ... | ... | @@ -14,7 +14,7 @@ note: required by a bound in `take` |
| 14 | 14 | LL | fn take(_f: impl FnMut(i32)) {} |
| 15 | 15 | | ^^^^^^^^^^ required by this bound in `take` |
| 16 | 16 | |
| 17 | error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut(i32, i32)` | |
| 17 | error[E0277]: expected an `FnMut(i32)` closure, found `impl FnMut(i32, i32)` | |
| 18 | 18 | --> $DIR/mismatch-fn-trait.rs:9:10 |
| 19 | 19 | | |
| 20 | 20 | LL | take(f) |
| ... | ... | @@ -29,7 +29,7 @@ note: required by a bound in `take` |
| 29 | 29 | LL | fn take(_f: impl FnMut(i32)) {} |
| 30 | 30 | | ^^^^^^^^^^ required by this bound in `take` |
| 31 | 31 | |
| 32 | error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut()` | |
| 32 | error[E0277]: expected an `FnMut(i32)` closure, found `impl FnMut()` | |
| 33 | 33 | --> $DIR/mismatch-fn-trait.rs:14:10 |
| 34 | 34 | | |
| 35 | 35 | LL | take(f) |
| ... | ... | @@ -44,7 +44,7 @@ note: required by a bound in `take` |
| 44 | 44 | LL | fn take(_f: impl FnMut(i32)) {} |
| 45 | 45 | | ^^^^^^^^^^ required by this bound in `take` |
| 46 | 46 | |
| 47 | error[E0277]: expected a `FnMut(i32)` closure, found `impl FnOnce(i32)` | |
| 47 | error[E0277]: expected an `FnMut(i32)` closure, found `impl FnOnce(i32)` | |
| 48 | 48 | --> $DIR/mismatch-fn-trait.rs:19:10 |
| 49 | 49 | | |
| 50 | 50 | LL | take(f) |
| ... | ... | @@ -59,7 +59,7 @@ note: required by a bound in `take` |
| 59 | 59 | LL | fn take(_f: impl FnMut(i32)) {} |
| 60 | 60 | | ^^^^^^^^^^ required by this bound in `take` |
| 61 | 61 | |
| 62 | error[E0277]: expected a `FnMut(i32)` closure, found `impl FnOnce(u32)` | |
| 62 | error[E0277]: expected an `FnMut(i32)` closure, found `impl FnOnce(u32)` | |
| 63 | 63 | --> $DIR/mismatch-fn-trait.rs:24:10 |
| 64 | 64 | | |
| 65 | 65 | LL | take(f) |
tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs+1-1| ... | ... | @@ -11,5 +11,5 @@ fn f<T: for<'r> X<'r> + ?Sized>() { |
| 11 | 11 | |
| 12 | 12 | fn main() { |
| 13 | 13 | f::<dyn for<'x> X<'x, F = i32>>(); |
| 14 | //~^ ERROR expected a `FnOnce(&i32)` closure, found `i32` | |
| 14 | //~^ ERROR expected an `FnOnce(&i32)` closure, found `i32` | |
| 15 | 15 | } |
tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce(&i32)` closure, found `i32` | |
| 1 | error[E0277]: expected an `FnOnce(&i32)` closure, found `i32` | |
| 2 | 2 | --> $DIR/check-trait-object-bounds-2.rs:13:9 |
| 3 | 3 | | |
| 4 | 4 | LL | f::<dyn for<'x> X<'x, F = i32>>(); |
tests/ui/traits/issue-87558.stderr+1-1| ... | ... | @@ -32,7 +32,7 @@ LL | impl Fn(&isize) for Error { |
| 32 | 32 | | |
| 33 | 33 | = help: implement the missing item: `fn call(&self, _: (&isize,)) -> <Self as FnOnce<(&isize,)>>::Output { todo!() }` |
| 34 | 34 | |
| 35 | error[E0277]: expected a `FnMut(&isize)` closure, found `Error` | |
| 35 | error[E0277]: expected an `FnMut(&isize)` closure, found `Error` | |
| 36 | 36 | --> $DIR/issue-87558.rs:3:21 |
| 37 | 37 | | |
| 38 | 38 | LL | impl Fn(&isize) for Error { |
tests/ui/traits/next-solver/diagnostics/const-host-effect-hrtb-no-ice.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ const fn with_positive<F: for<'a> [const] Fn(&'a ())>() {} |
| 7 | 7 | |
| 8 | 8 | const _: () = { |
| 9 | 9 | with_positive::<()>(); |
| 10 | //~^ ERROR expected a `Fn(&'a ())` closure, found `()` | |
| 10 | //~^ ERROR expected an `Fn(&'a ())` closure, found `()` | |
| 11 | 11 | //~| ERROR type mismatch resolving `<() as FnOnce<(&(),)>>::Output == ()` |
| 12 | 12 | }; |
| 13 | 13 |
tests/ui/traits/next-solver/diagnostics/const-host-effect-hrtb-no-ice.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(&'a ())` closure, found `()` | |
| 1 | error[E0277]: expected an `Fn(&'a ())` closure, found `()` | |
| 2 | 2 | --> $DIR/const-host-effect-hrtb-no-ice.rs:9:21 |
| 3 | 3 | | |
| 4 | 4 | LL | with_positive::<()>(); |
tests/ui/traits/next-solver/fn-trait.rs+4-4| ... | ... | @@ -18,11 +18,11 @@ fn main() { |
| 18 | 18 | require_fn(f); |
| 19 | 19 | require_fn(f as fn() -> i32); |
| 20 | 20 | require_fn(f as unsafe fn() -> i32); |
| 21 | //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32` | |
| 21 | //~^ ERROR: expected an `Fn()` closure, found `unsafe fn() -> i32` | |
| 22 | 22 | require_fn(g); |
| 23 | //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` | |
| 23 | //~^ ERROR: expected an `Fn()` closure, found `extern "C" fn() -> i32 {g}` | |
| 24 | 24 | require_fn(g as extern "C" fn() -> i32); |
| 25 | //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32` | |
| 25 | //~^ ERROR: expected an `Fn()` closure, found `extern "C" fn() -> i32` | |
| 26 | 26 | require_fn(h); |
| 27 | //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` | |
| 27 | //~^ ERROR: expected an `Fn()` closure, found `unsafe fn() -> i32 {h}` | |
| 28 | 28 | } |
tests/ui/traits/next-solver/fn-trait.stderr+4-4| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32` | |
| 1 | error[E0277]: expected an `Fn()` closure, found `unsafe fn() -> i32` | |
| 2 | 2 | --> $DIR/fn-trait.rs:20:16 |
| 3 | 3 | | |
| 4 | 4 | LL | require_fn(f as unsafe fn() -> i32); |
| ... | ... | @@ -15,7 +15,7 @@ note: required by a bound in `require_fn` |
| 15 | 15 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 16 | 16 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 17 | 17 | |
| 18 | error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` | |
| 18 | error[E0277]: expected an `Fn()` closure, found `extern "C" fn() -> i32 {g}` | |
| 19 | 19 | --> $DIR/fn-trait.rs:22:16 |
| 20 | 20 | | |
| 21 | 21 | LL | require_fn(g); |
| ... | ... | @@ -31,7 +31,7 @@ note: required by a bound in `require_fn` |
| 31 | 31 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 32 | 32 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 33 | 33 | |
| 34 | error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32` | |
| 34 | error[E0277]: expected an `Fn()` closure, found `extern "C" fn() -> i32` | |
| 35 | 35 | --> $DIR/fn-trait.rs:24:16 |
| 36 | 36 | | |
| 37 | 37 | LL | require_fn(g as extern "C" fn() -> i32); |
| ... | ... | @@ -47,7 +47,7 @@ note: required by a bound in `require_fn` |
| 47 | 47 | LL | fn require_fn(_: impl Fn() -> i32) {} |
| 48 | 48 | | ^^^^^^^^^^^ required by this bound in `require_fn` |
| 49 | 49 | |
| 50 | error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` | |
| 50 | error[E0277]: expected an `Fn()` closure, found `unsafe fn() -> i32 {h}` | |
| 51 | 51 | --> $DIR/fn-trait.rs:26:16 |
| 52 | 52 | | |
| 53 | 53 | LL | require_fn(h); |
tests/ui/type-alias-impl-trait/issue-63279.rs+2-2| ... | ... | @@ -4,11 +4,11 @@ type Closure = impl FnOnce(); |
| 4 | 4 | |
| 5 | 5 | #[define_opaque(Closure)] |
| 6 | 6 | fn c() -> Closure { |
| 7 | //~^ ERROR: expected a `FnOnce()` closure, found `()` | |
| 7 | //~^ ERROR: expected an `FnOnce()` closure, found `()` | |
| 8 | 8 | || -> Closure { || () } |
| 9 | 9 | //~^ ERROR: mismatched types |
| 10 | 10 | //~| ERROR: mismatched types |
| 11 | //~| ERROR: expected a `FnOnce()` closure, found `()` | |
| 11 | //~| ERROR: expected an `FnOnce()` closure, found `()` | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | fn main() {} |
tests/ui/type-alias-impl-trait/issue-63279.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `FnOnce()` closure, found `()` | |
| 1 | error[E0277]: expected an `FnOnce()` closure, found `()` | |
| 2 | 2 | --> $DIR/issue-63279.rs:6:11 |
| 3 | 3 | | |
| 4 | 4 | LL | fn c() -> Closure { |
| ... | ... | @@ -7,7 +7,7 @@ LL | fn c() -> Closure { |
| 7 | 7 | = help: the trait `FnOnce()` is not implemented for `()` |
| 8 | 8 | = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` |
| 9 | 9 | |
| 10 | error[E0277]: expected a `FnOnce()` closure, found `()` | |
| 10 | error[E0277]: expected an `FnOnce()` closure, found `()` | |
| 11 | 11 | --> $DIR/issue-63279.rs:8:11 |
| 12 | 12 | | |
| 13 | 13 | LL | || -> Closure { || () } |
tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.rs+2-2| ... | ... | @@ -8,10 +8,10 @@ type Tait = impl FnOnce() -> (); |
| 8 | 8 | |
| 9 | 9 | #[define_opaque(Tait)] |
| 10 | 10 | fn reify_as_tait() -> Thunk<Tait> { |
| 11 | //~^ ERROR: expected a `FnOnce()` closure, found `()` | |
| 11 | //~^ ERROR: expected an `FnOnce()` closure, found `()` | |
| 12 | 12 | Thunk::new(|cont| cont) |
| 13 | 13 | //~^ ERROR: mismatched types |
| 14 | //~| ERROR: expected a `FnOnce()` closure, found `()` | |
| 14 | //~| ERROR: expected an `FnOnce()` closure, found `()` | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | struct Thunk<F>(F); |
tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.stderr+2-2| ... | ... | @@ -10,7 +10,7 @@ LL | Thunk::new(|cont| cont) |
| 10 | 10 | = note: expected struct `Thunk<_>` |
| 11 | 11 | found unit type `()` |
| 12 | 12 | |
| 13 | error[E0277]: expected a `FnOnce()` closure, found `()` | |
| 13 | error[E0277]: expected an `FnOnce()` closure, found `()` | |
| 14 | 14 | --> $DIR/lazy_subtyping_of_opaques.rs:12:23 |
| 15 | 15 | | |
| 16 | 16 | LL | Thunk::new(|cont| cont) |
| ... | ... | @@ -19,7 +19,7 @@ LL | Thunk::new(|cont| cont) |
| 19 | 19 | = help: the trait `FnOnce()` is not implemented for `()` |
| 20 | 20 | = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` |
| 21 | 21 | |
| 22 | error[E0277]: expected a `FnOnce()` closure, found `()` | |
| 22 | error[E0277]: expected an `FnOnce()` closure, found `()` | |
| 23 | 23 | --> $DIR/lazy_subtyping_of_opaques.rs:10:23 |
| 24 | 24 | | |
| 25 | 25 | LL | fn reify_as_tait() -> Thunk<Tait> { |
tests/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(isize)` closure, found `S` | |
| 1 | error[E0277]: expected an `Fn(isize)` closure, found `S` | |
| 2 | 2 | --> $DIR/unboxed-closures-fnmut-as-fn.rs:27:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let x = call_it(&S, 22); |
tests/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 1 | error[E0277]: expected an `Fn(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 2 | 2 | --> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let x = call_it(&square, 22); |
| ... | ... | @@ -14,7 +14,7 @@ note: required by a bound in `call_it` |
| 14 | 14 | LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { |
| 15 | 15 | | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` |
| 16 | 16 | |
| 17 | error[E0277]: expected a `FnMut(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 17 | error[E0277]: expected an `FnMut(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 18 | 18 | --> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25 |
| 19 | 19 | | |
| 20 | 20 | LL | let y = call_it_mut(&mut square, 22); |
| ... | ... | @@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut` |
| 30 | 30 | LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { |
| 31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` |
| 32 | 32 | |
| 33 | error[E0277]: expected a `FnOnce(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 33 | error[E0277]: expected an `FnOnce(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` | |
| 34 | 34 | --> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26 |
| 35 | 35 | | |
| 36 | 36 | LL | let z = call_it_once(square, 22); |
tests/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 1 | error[E0277]: expected an `Fn(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 2 | 2 | --> $DIR/unboxed-closures-wrong-abi.rs:20:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let x = call_it(&square, 22); |
| ... | ... | @@ -13,7 +13,7 @@ note: required by a bound in `call_it` |
| 13 | 13 | LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { |
| 14 | 14 | | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` |
| 15 | 15 | |
| 16 | error[E0277]: expected a `FnMut(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 16 | error[E0277]: expected an `FnMut(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 17 | 17 | --> $DIR/unboxed-closures-wrong-abi.rs:25:25 |
| 18 | 18 | | |
| 19 | 19 | LL | let y = call_it_mut(&mut square, 22); |
| ... | ... | @@ -28,7 +28,7 @@ note: required by a bound in `call_it_mut` |
| 28 | 28 | LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { |
| 29 | 29 | | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` |
| 30 | 30 | |
| 31 | error[E0277]: expected a `FnOnce(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 31 | error[E0277]: expected an `FnOnce(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | |
| 32 | 32 | --> $DIR/unboxed-closures-wrong-abi.rs:30:26 |
| 33 | 33 | | |
| 34 | 34 | LL | let z = call_it_once(square, 22); |
tests/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0277]: expected a `Fn(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 1 | error[E0277]: expected an `Fn(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 2 | 2 | --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:21:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let x = call_it(&square, 22); |
| ... | ... | @@ -14,7 +14,7 @@ note: required by a bound in `call_it` |
| 14 | 14 | LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { |
| 15 | 15 | | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` |
| 16 | 16 | |
| 17 | error[E0277]: expected a `FnMut(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 17 | error[E0277]: expected an `FnMut(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 18 | 18 | --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:26:25 |
| 19 | 19 | | |
| 20 | 20 | LL | let y = call_it_mut(&mut square, 22); |
| ... | ... | @@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut` |
| 30 | 30 | LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { |
| 31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` |
| 32 | 32 | |
| 33 | error[E0277]: expected a `FnOnce(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 33 | error[E0277]: expected an `FnOnce(&isize)` closure, found `unsafe fn(isize) -> isize {square}` | |
| 34 | 34 | --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:31:26 |
| 35 | 35 | | |
| 36 | 36 | LL | let z = call_it_once(square, 22); |