Skip to content

Auto-derefencing is too eager #6257

@huonw

Description

@huonw

The following seems annoying (and is especially so for writing macros/syntax extensions)

fn main() {
    let x: & int =  &1;

    x.eq(&x); // `x == x` works fine
}
auto-deref.rs:6:9: 6:11 error: mismatched types: expected `&int` but found `&&int` (expected int but found &-ptr)
auto-deref.rs:6     x.eq(&x);
                         ^~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions