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

ices/80409.rs: fixed with no errors #1508

Merged
merged 1 commit into from
Feb 11, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#80409

use std::marker::PhantomData;

struct FsmBuilder<TFsm> {
    _fsm: PhantomData<TFsm>,
}

impl<TFsm> FsmBuilder<TFsm> {
    fn state(&mut self) -> FsmStateBuilder<TFsm> {
        todo!()
    }
}

struct FsmStateBuilder<TFsm> {
    _state: PhantomData<TFsm>,
}

impl<TFsm> FsmStateBuilder<TFsm> {
    fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {}
}

trait Fsm {
    type Context;
}

struct StateContext<'a, TFsm: Fsm> {
    context: &'a mut TFsm::Context,
}

fn main() {
    let mut builder: FsmBuilder<usize> = todo!();
    builder.state().on_entry(|_| {});
}
=== stdout ===
=== stderr ===
warning: unreachable statement
  --> /home/runner/work/glacier/glacier/ices/80409.rs:31:5
   |
30 |     let mut builder: FsmBuilder<usize> = todo!();
   |                                          ------- any code following this expression is unreachable
31 |     builder.state().on_entry(|_| {});
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
   |
   = note: `#[warn(unreachable_code)]` on by default

warning: unused variable: `builder`
  --> /home/runner/work/glacier/glacier/ices/80409.rs:30:13
   |
30 |     let mut builder: FsmBuilder<usize> = todo!();
   |             ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: field `context` is never read
  --> /home/runner/work/glacier/glacier/ices/80409.rs:26:5
   |
25 | struct StateContext<'a, TFsm: Fsm> {
   |        ------------ field in this struct
26 |     context: &'a mut TFsm::Context,
   |     ^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 3 warnings emitted

==============

=== stdout ===
=== stderr ===
warning: unreachable statement
  --> /home/runner/work/glacier/glacier/ices/80409.rs:31:5
   |
30 |     let mut builder: FsmBuilder<usize> = todo!();
   |                                          ------- any code following this expression is unreachable
31 |     builder.state().on_entry(|_| {});
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
   |
   = note: `#[warn(unreachable_code)]` on by default

warning: unused variable: `builder`
  --> /home/runner/work/glacier/glacier/ices/80409.rs:30:13
   |
30 |     let mut builder: FsmBuilder<usize> = todo!();
   |             ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_builder`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: field `context` is never read
  --> /home/runner/work/glacier/glacier/ices/80409.rs:26:5
   |
25 | struct StateContext<'a, TFsm: Fsm> {
   |        ------------ field in this struct
26 |     context: &'a mut TFsm::Context,
   |     ^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 3 warnings emitted

==============
@Alexendoo Alexendoo merged commit 7bd7f5d into master Feb 11, 2023
@Alexendoo Alexendoo deleted the autofix/ices/80409.rs branch February 11, 2023 14:34
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