Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method lookup fails for operator #21922

Closed
sellibitze opened this issue Feb 4, 2015 · 3 comments
Closed

Method lookup fails for operator #21922

sellibitze opened this issue Feb 4, 2015 · 3 comments
Labels
A-resolve Area: Path resolution P-medium Medium priority

Comments

@sellibitze
Copy link
Contributor

libcore/ops.rs provides all kinds of operator implementations for “value” and “reference type” combinations. But one thing does not seem to work like it should:

use std::ops::Add;
fn show(z: i32) {
    println!("{}", z)
}
fn main() {
    let x = 23;
    let y = 42;
    show(Add::add( x,  y));
    show(Add::add( x, &y));
    show(Add::add(&x,  y));
    show(Add::add(&x, &y));
    show( x +  y);
    show( x + &y);  // <-- everything but this works
    show(&x +  y);
    show(&x + &y);
}

I think there is a problem with how these methods are looked up because the UFCS apparently works. This issue currently kind of blocks the libcoretest/ops.rs tests I was planning to add.

cc @aturon

@kmcallister kmcallister added the A-resolve Area: Path resolution label Feb 4, 2015
@aturon
Copy link
Member

aturon commented Mar 10, 2015

cc @nikomatsakis

@aturon
Copy link
Member

aturon commented Mar 10, 2015

triage: I-nominated

@rust-highfive rust-highfive added this to the 1.0 beta milestone Mar 10, 2015
@nrc nrc removed this from the 1.0 beta milestone Mar 11, 2015
@pnkfelix
Copy link
Member

@nikomatsakis points out that Dissecting how we type-check plus is important.

But, for this particular bug, we are going to categorize it as P-high, not a 1.0 blocker.

@pnkfelix pnkfelix added P-medium Medium priority and removed I-nominated labels Mar 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Path resolution P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

6 participants