forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not ICE when we have fn pointer Fn obligations with bound vars in …
…the self type
- Loading branch information
1 parent
f63ccaf
commit 4fe232b
Showing
3 changed files
with
44 additions
and
3 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,19 @@ | ||
error[E0277]: expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())` | ||
--> $DIR/fn-ptr.rs:12:5 | ||
| | ||
LL | ice(); | ||
| ^^^ expected an `Fn<(&'w (),)>` closure, found `fn(&'w ())` | ||
| | ||
= help: the trait `for<'w> Fn<(&'w (),)>` is not implemented for `fn(&'w ())` | ||
note: required by a bound in `ice` | ||
--> $DIR/fn-ptr.rs:7:25 | ||
| | ||
LL | fn ice() | ||
| --- required by a bound in this function | ||
LL | where | ||
LL | for<'w> fn(&'w ()): Fn(&'w ()), | ||
| ^^^^^^^^^^ required by this bound in `ice` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,14 @@ | ||
// revisions: classic next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
//[next] check-pass | ||
|
||
fn ice() | ||
where | ||
for<'w> fn(&'w ()): Fn(&'w ()), | ||
{ | ||
} | ||
|
||
fn main() { | ||
ice(); | ||
//[classic]~^ ERROR expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())` | ||
} |