-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove invalid suggestion involving Fn trait bound
- Loading branch information
1 parent
d5fd37f
commit f8c10ff
Showing
3 changed files
with
30 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
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,13 @@ | ||
// Regression test for the invalid suggestion in #85735 (the | ||
// underlying issue #21974 still exists here). | ||
|
||
trait Foo {} | ||
impl<'a, 'b, T> Foo for T | ||
where | ||
T: FnMut(&'a ()), | ||
//~^ ERROR: type annotations needed [E0283] | ||
T: FnMut(&'b ()), | ||
{ | ||
} | ||
|
||
fn main() {} |
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[E0283]: type annotations needed | ||
--> $DIR/issue-85735.rs:7:8 | ||
| | ||
LL | T: FnMut(&'a ()), | ||
| ^^^^^^^^^^^^^ cannot infer type for type parameter `T` | ||
| | ||
::: $SRC_DIR/core/src/ops/function.rs:LL:COL | ||
| | ||
LL | pub trait FnMut<Args>: FnOnce<Args> { | ||
| ----------------------------------- required by this bound in `FnMut` | ||
| | ||
= note: cannot satisfy `T: FnMut<(&'a (),)>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0283`. |