Skip to content

rustc error references the old '~' syntax for boxes #15052

Closed
@simias

Description

@simias
struct A;

impl A {
    fn foo(&mut self) {
    }
}

fn main() {
    let a = box A;

    a.foo();
}

Gives:

test.rs:11:5: 11:6 error: cannot borrow immutable dereference of `~`-pointer `*a` as mutable
test.rs:11     a.foo();

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions