Skip to content

Commit 8f88cec

Browse files
committed
Add regression test for #57404
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
1 parent 7f42e58 commit 8f88cec

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/test/ui/typeck/issue-57404.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![feature(unboxed_closures)]
2+
#![feature(fn_traits)]
3+
4+
fn main() {
5+
let handlers: Option<Box<dyn for<'a> FnMut<&'a mut (), Output=()>>> = None;
6+
handlers.unwrap().as_mut().call_mut(&mut ()); //~ ERROR: `&mut ()` is not a tuple
7+
}

src/test/ui/typeck/issue-57404.stderr

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0277]: `&mut ()` is not a tuple
2+
--> $DIR/issue-57404.rs:6:41
3+
|
4+
LL | handlers.unwrap().as_mut().call_mut(&mut ());
5+
| -------- -^^^^^^
6+
| | |
7+
| | the trait `Tuple` is not implemented for `&mut ()`
8+
| | help: consider removing the leading `&`-reference
9+
| required by a bound introduced by this call
10+
|
11+
note: required by a bound in `call_mut`
12+
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)