Skip to content

Variables used in when still considered unused #1265

Closed
@nikomatsakis

Description

@nikomatsakis

The following code gets an error about an unused variable b:

use std;

fn foo(a: int, b: int) {
    alt a {
      _ when a == b { log_err "hi"; }
      _ { log_err "ho"; }
    }
}

fn main() {
    foo(1,1);
    foo(1,2);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions