Skip to content

Matching of static variable name with some function's parameter name gives error. #23716

Closed
@demelev

Description

@demelev

Rustc version: rustc 1.0.0-nightly (b0aad7d 2015-03-22) (built 2015-03-23)

static text : i32 = 1i32;

fn read_block(text: &str) {
}

fn main() {
}
src\main.rs:79:15: 79:19 error: static variables cannot be referenced in a patte
rn, use a `const` instead
src\main.rs:79 fn read_block(text: &str) {
                             ^~~~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions