Skip to content

Commit

Permalink
Fix test case and issue number
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 15, 2019
1 parent 74329bf commit 564c78a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 60 deletions.
36 changes: 0 additions & 36 deletions src/test/ui/unboxed-closures/issue-30904.rs

This file was deleted.

24 changes: 0 additions & 24 deletions src/test/ui/unboxed-closures/issue-30904.stderr

This file was deleted.

18 changes: 18 additions & 0 deletions src/test/ui/unboxed-closures/issue-30906.rs
@@ -0,0 +1,18 @@
#![feature(fn_traits, unboxed_closures)]

fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {}

struct Compose<F,G>(F,G);
impl<T,F,G> FnOnce<(T,)> for Compose<F,G>
where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> {
type Output = G::Output;
extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output {
(self.1)((self.0)(x))
}
}

fn bad<T>(f: fn(&'static str) -> T) {
test(Compose(f, |_| {})); //~ ERROR: mismatched types
}

fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/unboxed-closures/issue-30906.stderr
@@ -0,0 +1,12 @@
error[E0308]: mismatched types
--> $DIR/issue-30906.rs:15:5
|
LL | test(Compose(f, |_| {}));
| ^^^^ one type is more general than the other
|
= note: expected type `std::ops::FnOnce<(&'x str,)>`
found type `std::ops::FnOnce<(&str,)>`

error: aborting due to previous error

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

0 comments on commit 564c78a

Please sign in to comment.