Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add regression test for #57404
Signed-off-by: Yuki Okushi <[email protected]>
  • Loading branch information
JohnTitor committed Dec 20, 2022
commit 8f88cecab64504e9f8317e96bba41feb4ac10a29
7 changes: 7 additions & 0 deletions src/test/ui/typeck/issue-57404.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![feature(unboxed_closures)]
#![feature(fn_traits)]

fn main() {
let handlers: Option<Box<dyn for<'a> FnMut<&'a mut (), Output=()>>> = None;
handlers.unwrap().as_mut().call_mut(&mut ()); //~ ERROR: `&mut ()` is not a tuple
}
16 changes: 16 additions & 0 deletions src/test/ui/typeck/issue-57404.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0277]: `&mut ()` is not a tuple
--> $DIR/issue-57404.rs:6:41
|
LL | handlers.unwrap().as_mut().call_mut(&mut ());
| -------- -^^^^^^
| | |
| | the trait `Tuple` is not implemented for `&mut ()`
| | help: consider removing the leading `&`-reference
| required by a bound introduced by this call
|
note: required by a bound in `call_mut`
--> $SRC_DIR/core/src/ops/function.rs:LL:COL

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.