Skip to content

Using &mut Trait requires mut local variable for some cases #10088

Closed
@mukilan

Description

@mukilan

Looks like some cases were not tested in #8398

The following code:

use std::rt::io::Reader;
use std::rt::io::extensions::ReaderUtil;


fn parse(reader: &mut Reader) {
    reader.read_byte();
}

fn main() {
}

still yields a compilation error:

test.rs:6:4: 6:10 error: cannot borrow immutable argument as mutable
test.rs:6     reader.read_byte();

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