-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #105945 - JohnTitor:issue-57404, r=compiler-errors
Add regression test for #57404 r? `@compiler-errors` Closes #57404 Signed-off-by: Yuki Okushi <jtitor@2k36.org>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |