This repository was archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit b9942df
committed
ices/58355.rs: fixed with errors
=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
--> /home/runner/work/glacier/glacier/ices/58355.rs:3:30
|
3 | pub fn foo(callback: fn() -> ToString) {
| ^^^^^^^^
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
3 | pub fn foo(callback: fn() -> dyn ToString) {
| +++
warning: trait objects without an explicit `dyn` are deprecated
--> /home/runner/work/glacier/glacier/ices/58355.rs:4:27
|
4 | let mut x: Option<Box<Fn() -> ToString>> = None;
| ^^^^^^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
4 | let mut x: Option<Box<dyn Fn() -> ToString>> = None;
| +++
warning: trait objects without an explicit `dyn` are deprecated
--> /home/runner/work/glacier/glacier/ices/58355.rs:4:35
|
4 | let mut x: Option<Box<Fn() -> ToString>> = None;
| ^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
4 | let mut x: Option<Box<Fn() -> dyn ToString>> = None;
| +++
error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time
--> /home/runner/work/glacier/glacier/ices/58355.rs:5:14
|
5 | x = Some(Box::new(callback));
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn ToString`, the trait `Sized` is not implemented for `dyn ToString`
= note: required because it appears within the type `fn() -> dyn ToString`
= note: required for the cast from `fn() -> dyn ToString` to the object type `dyn Fn() -> (dyn ToString + 'static)`
error: aborting due to previous error; 3 warnings emitted
For more information about this error, try `rustc --explain E0277`.
==============1 parent 6eedf3a commit b9942dfCopy full SHA for b9942df
1 file changed
+0
-0
lines changedices/58355.rs renamed to fixed/58355.rs
Copy file name to clipboardFile renamed without changes.
0 commit comments