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

ices/99228.sh: fixed with no errors #1419

Merged
merged 1 commit into from
Sep 16, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#99228

#!/bin/bash

rustc -Zvalidate-mir - <<'EOF'

#![feature(let_else)]
fn example_let_else(value: Option<String>) {
    let _inner = value else {
        return;
    };
}
fn main() {
    example_let_else(None);
}

EOF

=== stdout ===
=== stderr ===
warning: irrefutable `let...else` pattern
 --> <anon>:4:5
  |
4 | /     let _inner = value else {
5 | |         return;
6 | |     };
  | |______^
  |
  = note: `#[warn(irrefutable_let_patterns)]` on by default
  = note: this pattern will always match, so the `else` clause is useless
  = help: consider removing the `else` clause

warning: 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: irrefutable `let...else` pattern
 --> <anon>:4:5
  |
4 | /     let _inner = value else {
5 | |         return;
6 | |     };
  | |______^
  |
  = note: `#[warn(irrefutable_let_patterns)]` on by default
  = note: this pattern will always match, so the `else` clause is useless
  = help: consider removing the `else` clause

warning: 1 warning emitted

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

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

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

Looks like the fix could end up being reverted, but I'll merge for now

@Alexendoo Alexendoo merged commit 6eedf3a into master Sep 16, 2022
@Alexendoo Alexendoo deleted the autofix/ices/99228.sh branch September 16, 2022 11:04
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