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

ices/96258.rs: fixed with errors #1330

Merged
merged 1 commit into from
Jul 2, 2022
Merged

ices/96258.rs: fixed with errors #1330

merged 1 commit into from
Jul 2, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 2, 2022

Issue: rust-lang/rust#96258

#![warn(rust_2021_incompatible_closure_captures)]
impl Numberer {
    pub(crate) async fn new(
        interval: Duration,
=== stdout ===
=== stderr ===
error: this file contains an unclosed delimiter
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:29
  |
2 | impl Numberer {
  |               - unclosed delimiter
3 |     pub(crate) async fn new(
  |                            - unclosed delimiter
4 |         interval: Duration,
  |                             ^

error: expected one of `->`, `where`, or `{`, found `}`
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:29
  |
3 |     pub(crate) async fn new(
  |                         --- while parsing this `fn`
4 |         interval: Duration,
  |                             ^ expected one of `->`, `where`, or `{`

error: associated function in `impl` without body
 --> /home/runner/work/glacier/glacier/ices/96258.rs:3:5
  |
3 | /     pub(crate) async fn new(
4 | |         interval: Duration,
  | |                            ^- help: provide a definition for the function: `{ <body> }`
  | |____________________________|
  | 

error[E0412]: cannot find type `Numberer` in this scope
 --> /home/runner/work/glacier/glacier/ices/96258.rs:2:6
  |
2 | impl Numberer {
  |      ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Duration` in this scope
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:19
  |
4 |         interval: Duration,
  |                   ^^^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
2 | use core::time::Duration;
  |
2 | use std::time::Duration;
  |

warning: changes to closure capture in Rust 2021 will affect drop order
 --> /home/runner/work/glacier/glacier/ices/96258.rs:3:5
  |
3 | /     pub(crate) async fn new(
4 | |         interval: Duration,
  | |         --------           ^ in Rust 2018, `interval` is dropped here along with the closure, but in Rust 2021 `interval` is not part of the closure
  | |_________|__________________|
  |           |
  |           in Rust 2018, this causes the closure to capture `interval`, but in Rust 2021, it has no effect
  |
note: the lint level is defined here
 --> /home/runner/work/glacier/glacier/ices/96258.rs:1:9
  |
1 | #![warn(rust_2021_incompatible_closure_captures)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `interval` to be fully captured
  |
3 ~     { let _ = &interval; pub(crate) async fn new(
4 ~         interval: Duration, }
  |

error: aborting due to 5 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
error: this file contains an unclosed delimiter
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:29
  |
2 | impl Numberer {
  |               - unclosed delimiter
3 |     pub(crate) async fn new(
  |                            - unclosed delimiter
4 |         interval: Duration,
  |                             ^

error: expected one of `->`, `where`, or `{`, found `}`
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:29
  |
3 |     pub(crate) async fn new(
  |                         --- while parsing this `fn`
4 |         interval: Duration,
  |                             ^ expected one of `->`, `where`, or `{`

error: associated function in `impl` without body
 --> /home/runner/work/glacier/glacier/ices/96258.rs:3:5
  |
3 | /     pub(crate) async fn new(
4 | |         interval: Duration,
  | |                            ^- help: provide a definition for the function: `{ <body> }`
  | |____________________________|
  | 

error[E0412]: cannot find type `Numberer` in this scope
 --> /home/runner/work/glacier/glacier/ices/96258.rs:2:6
  |
2 | impl Numberer {
  |      ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Duration` in this scope
 --> /home/runner/work/glacier/glacier/ices/96258.rs:4:19
  |
4 |         interval: Duration,
  |                   ^^^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
2 | use core::time::Duration;
  |
2 | use std::time::Duration;
  |

warning: changes to closure capture in Rust 2021 will affect drop order
 --> /home/runner/work/glacier/glacier/ices/96258.rs:3:5
  |
3 | /     pub(crate) async fn new(
4 | |         interval: Duration,
  | |         --------           ^ in Rust 2018, `interval` is dropped here along with the closure, but in Rust 2021 `interval` is not part of the closure
  | |_________|__________________|
  |           |
  |           in Rust 2018, this causes the closure to capture `interval`, but in Rust 2021, it has no effect
  |
note: the lint level is defined here
 --> /home/runner/work/glacier/glacier/ices/96258.rs:1:9
  |
1 | #![warn(rust_2021_incompatible_closure_captures)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `interval` to be fully captured
  |
3 ~     { let _ = &interval; pub(crate) async fn new(
4 ~         interval: Duration, }
  |

error: aborting due to 5 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0412`.
==============
@JohnTitor JohnTitor merged commit 673003b into master Jul 2, 2022
@JohnTitor JohnTitor deleted the autofix/ices/96258.rs branch July 2, 2022 05:57
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