Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5c1cd6c
Update cargo
dtolnay Apr 3, 2019
a37c33b
Mark unix::ffi::OsStrExt methods as inline
sugar700 Apr 4, 2019
a964921
Use declare_lint_pass! and impl_lint_pass! in more places
hgallagher1993 Apr 4, 2019
d6b91fe
Update cargo
dtolnay Apr 4, 2019
1bf04c9
std: Upgrade `compiler_builtins` to fix wasi linkage
alexcrichton Apr 2, 2019
7994197
Make FnBox a subtrait of FnOnce.
qnighy Oct 28, 2018
059ec76
Add Fn* blanket impls for Box.
qnighy Oct 28, 2018
480dcb4
Add tests for boxed_closure_impls.
qnighy Oct 28, 2018
219097e
Add unstable-book articles on fnbox and boxed_closure_impls.
qnighy Oct 28, 2018
e55d82c
Fix expectations on some ui tests involving FnOnce.
qnighy Oct 28, 2018
4dcd6cc
Fix failing tests.
qnighy Feb 3, 2019
a38f292
We already have unsized_locals in stage0.
qnighy Feb 10, 2019
45c0b28
Remove FnBox specialization of impl FnOnce for Box<impl FnOnce>.
qnighy Feb 11, 2019
ecc3e89
Stabilize boxed_closure_impls in 1.35.0.
crlf0710 Feb 11, 2019
440e873
Simplify fnbox docs.
qnighy Feb 11, 2019
7a63c7f
Add ignore to doc code
qnighy Feb 11, 2019
471db2b
wasm32: Default to a "static" relocation model
alexcrichton Apr 4, 2019
8c0e786
Rollup merge of #59500 - crlf0710:boxed-closure-impls, r=cramertj
Centril Apr 5, 2019
1f05de7
Rollup merge of #59643 - alexcrichton:wasi-symbols, r=sanxiyn
Centril Apr 5, 2019
bc995f4
Rollup merge of #59681 - dtolnay:cargo, r=alexcrichton
Centril Apr 5, 2019
6070d47
Rollup merge of #59690 - xfix:patch-17, r=cramertj
Centril Apr 5, 2019
3600e4d
Rollup merge of #59702 - hgallagher1993:origin, r=Centril
Centril Apr 5, 2019
c03fa7b
Rollup merge of #59712 - alexcrichton:wasm-static-not-pic, r=eddyb
Centril Apr 5, 2019
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
Fix failing tests.
  • Loading branch information
qnighy authored and crlf0710 committed Apr 4, 2019
commit 4dcd6cc208e143309d481f0ecf4051bd9d139a18
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() {
});

// Call it
f();
f(&42);
}
```

Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/unsized-locals/fnbox-compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ use std::boxed::FnBox;

fn call_it<T>(f: Box<dyn FnBox(&i32) -> T>) -> T {
f(&42)
//~^ERROR implementation of `std::ops::FnOnce` is not general enough
}

fn main() {
let s = "hello".to_owned();
assert_eq!(&call_it(Box::new(|| s)) as &str, "hello");
assert_eq!(&call_it(Box::new(|_| s)) as &str, "hello");
}
30 changes: 7 additions & 23 deletions src/test/ui/unsized-locals/fnbox-compat.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/fnbox-compat.rs:11:34
error: implementation of `std::ops::FnOnce` is not general enough
--> $DIR/fnbox-compat.rs:6:5
|
LL | assert_eq!(&call_it(Box::new(|| s)) as &str, "hello");
| ^^
| |
| expected closure that takes 1 argument
| takes 0 arguments
help: consider changing the closure to take and ignore the expected argument
LL | f(&42)
| ^^^^^^
|
LL | assert_eq!(&call_it(Box::new(|_| s)) as &str, "hello");
| ^^^
= note: `std::ops::FnOnce<(&'0 i32,)>` would have to be implemented for the type `std::boxed::Box<(dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=T> + 'static)>`, for some specific lifetime `'0`
= note: but `std::ops::FnOnce<(&'1 i32,)>` is actually implemented for the type `std::boxed::Box<(dyn std::boxed::FnBox<(&'1 i32,), Output=T> + '_)>`, for some specific lifetime `'1`

error[E0277]: the size for values of type `dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=_>` cannot be known at compilation time
--> $DIR/fnbox-compat.rs:11:25
|
LL | assert_eq!(&call_it(Box::new(|| s)) as &str, "hello");
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::boxed::FnBox<(&'r i32,), Output=_>`
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required by `<std::boxed::Box<T>>::new`

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors occurred: E0277, E0593.
For more information about an error, try `rustc --explain E0277`.