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

ices/72651.sh: fixed with no errors #532

Merged
merged 1 commit into from
Oct 31, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#72651

#!/bin/bash

rustc --emit=mir --edition 2018 - << EOF

fn main() {}

struct StructA {}
struct StructB {}

impl StructA {
    fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
        true
    }
}

async fn get_struct_a_async() -> StructA {
    StructA {}
}

async fn ice() {
    match Some(StructB {}) {
        Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
        _ => {}
    }
}

EOF
=== stdout ===
=== stderr ===
warning: unused variable: `struct_b`
 --> <anon>:8:34
  |
8 |     fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
  |                                  ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_struct_b`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: struct is never constructed: `StructA`
 --> <anon>:4:8
  |
4 | struct StructA {}
  |        ^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: struct is never constructed: `StructB`
 --> <anon>:5:8
  |
5 | struct StructB {}
  |        ^^^^^^^

warning: associated function is never used: `fn_taking_struct_b`
 --> <anon>:8:8
  |
8 |     fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
  |        ^^^^^^^^^^^^^^^^^^

warning: function is never used: `get_struct_a_async`
  --> <anon>:13:10
   |
13 | async fn get_struct_a_async() -> StructA {
   |          ^^^^^^^^^^^^^^^^^^

warning: function is never used: `ice`
  --> <anon>:17:10
   |
17 | async fn ice() {
   |          ^^^

warning: 6 warnings emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `struct_b`
 --> <anon>:8:34
  |
8 |     fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
  |                                  ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_struct_b`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: struct is never constructed: `StructA`
 --> <anon>:4:8
  |
4 | struct StructA {}
  |        ^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: struct is never constructed: `StructB`
 --> <anon>:5:8
  |
5 | struct StructB {}
  |        ^^^^^^^

warning: associated function is never used: `fn_taking_struct_b`
 --> <anon>:8:8
  |
8 |     fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
  |        ^^^^^^^^^^^^^^^^^^

warning: function is never used: `get_struct_a_async`
  --> <anon>:13:10
   |
13 | async fn get_struct_a_async() -> StructA {
   |          ^^^^^^^^^^^^^^^^^^

warning: function is never used: `ice`
  --> <anon>:17:10
   |
17 | async fn ice() {
   |          ^^^

warning: 6 warnings emitted

==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rust-lang/rust#78393 fixed this ICE.

@JohnTitor JohnTitor merged commit c76484b into master Oct 31, 2020
@JohnTitor JohnTitor deleted the autofix/ices/72651.sh branch October 31, 2020 12:25
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