Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/101297.rs: fixed with errors #1412

Merged
merged 1 commit into from
Sep 8, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 8, 2022

Issue: rust-lang/rust#101297

fn ice() -> impl AsRef<Fn(&())> {
    todo!()
}

pub fn main() {}
=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
 --> /home/runner/work/glacier/glacier/ices/101297.rs:1:24
  |
1 | fn ice() -> impl AsRef<Fn(&())> {
  |                        ^^^^^^^
  |
  = 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`
  |
1 - fn ice() -> impl AsRef<Fn(&())> {
1 + fn ice() -> impl AsRef<dyn Fn(&())> {
  |

error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/101297.rs:1:13
  |
1 | fn ice() -> impl AsRef<Fn(&())> {
  |             ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
 --> /home/runner/work/glacier/glacier/ices/101297.rs:1:24
  |
1 | fn ice() -> impl AsRef<Fn(&())> {
  |                        ^^^^^^^
  |
  = 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`
  |
1 - fn ice() -> impl AsRef<Fn(&())> {
1 + fn ice() -> impl AsRef<dyn Fn(&())> {
  |

error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/101297.rs:1:13
  |
1 | fn ice() -> impl AsRef<Fn(&())> {
  |             ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit 97ab2f6 into master Sep 8, 2022
@Alexendoo Alexendoo deleted the autofix/ices/101297.rs branch September 8, 2022 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants