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

ices/94073.sh: fixed with no errors #1144

Merged
merged 1 commit into from
Feb 21, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#94073

rustc --emit=mir -Zmir-opt-level=3 - 2>&1 << EOF

use std::mem;

#[derive(Copy, Clone)]
enum Never {}

union Foo {
    a: u64,
    b: Never
}

fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }

fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }

fn main() {
    println!("{}", mem::size_of::<Foo>());

    let f = [Foo { a: 42 }, Foo { a: 10 }];
    println!("{:?}", unsafe { f[0].a });
}

EOF
=== stdout ===
warning: field is never read: `b`
 --> <anon>:9:5
  |
9 |     b: Never
  |     ^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
  --> <anon>:12:4
   |
12 | fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }
   |    ^^^

warning: function is never used: `bar`
  --> <anon>:14:4
   |
14 | fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }
   |    ^^^

warning: 3 warnings emitted

=== stderr ===
==============

=== stdout ===
warning: field is never read: `b`
 --> <anon>:9:5
  |
9 |     b: Never
  |     ^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
  --> <anon>:12:4
   |
12 | fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }
   |    ^^^

warning: function is never used: `bar`
  --> <anon>:14:4
   |
14 | fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }
   |    ^^^

warning: 3 warnings emitted

=== stderr ===
==============
@Alexendoo Alexendoo merged commit ee27795 into master Feb 21, 2022
@Alexendoo Alexendoo deleted the autofix/ices/94073.sh branch February 21, 2022 12: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