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

UFCS inconsistencies #21122

Closed
bluss opened this issue Jan 14, 2015 · 1 comment
Closed

UFCS inconsistencies #21122

bluss opened this issue Jan 14, 2015 · 1 comment
Labels
A-resolve Area: Name resolution

Comments

@bluss
Copy link
Member

bluss commented Jan 14, 2015

Methods on Vec are not available even if Vec is in the prelude;

let v: Vec<i32> = Vec::new();
Vec::len(&v);  // (a) -> error: unresolved name `Vec::len`
std::vec::Vec::len(&v);  // (b) -> OK!

fix: use std::vec::Vec; and both lines (a) and (b) compile!

BitvSet is just weird and doesn't ever cooperate:

use std::collections::BitvSet;
let bs = BitvSet::new();
BitvSet::len(&bs); // error: unresolved name `BitvSet::len`

use was fine with Vec -- but not this time.

And this is weirder:

extern crate collections;

use std::collections::BitvSet;

fn main() {
    let bs = BitvSet::new();
    BitvSet::len(&bs); // error: unresolved name `BitvSet::len`
    std::collections::BitvSet::len(&bs); // error: unresolved name `std::collections::BitvSet::len`
    collections::bitv_set::BitvSet::len(&bs); // error: unresolved name `collections::bitv_set::BitvSet::len`
    collections::bit::BitvSet::len(&bs);  // error: function `len` is private
}

UFCS tracking issue: #16293

@kmcallister kmcallister added the A-resolve Area: Name resolution label Jan 14, 2015
@bluss
Copy link
Member Author

bluss commented May 4, 2015

These are resolved.

@bluss bluss closed this as completed May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

2 participants