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

cgmath::vector::Vector shadows std::vec::Vector #43

Closed
rsaarelm opened this issue Feb 15, 2014 · 6 comments
Closed

cgmath::vector::Vector shadows std::vec::Vector #43

rsaarelm opened this issue Feb 15, 2014 · 6 comments

Comments

@rsaarelm
Copy link
Contributor

In modules that have

use cgmath::vector::Vector;

in them, you can no longer take slices from native rust vectors, eg.

let a = ~[1, 2, 3];
let b = a.as_slice();

"error: type ~[int] does not implement any method in scope named as_slice"

The method as_slice is supposed to come from module std::vec::Vector.

A workaround is to rename the cgmath import, eg.

use cgVector = cgmath::vector::Vector;

Possible quick fix: Rename cgmath::vector::Vector into Vec?

@brendanzab
Copy link
Collaborator

Oh dear. I was actually planning on renaming Vec2 etc. to Vector2. :(

Calling [] vectors is really annoying.

@brendanzab
Copy link
Collaborator

I'm pretty sure this isn't a problem now.

@bfops
Copy link
Contributor

bfops commented Jul 21, 2014

I'm still having this issue; importing cgmath::vector::Vector causes as_slice to no longer be in scope. rustc is the nightly build from July 15, and a fresh github pull of cgmath-rs.

My code is at https://github.com/RobotGymnast/playform/blob/5667371f9c4682cac0dc856e6ded9ae62266e461/src/main.rs; it's committed with slice using explicit bounds instead of as_slice. Switching to as_slice causes the scope error for me.

@brendanzab
Copy link
Collaborator

Yack. I wonder what other name we could give it? :[

@emberian
Copy link
Collaborator

Vectar, and we can rename the library to "piratemath"

On Wed, Jul 23, 2014 at 8:35 PM, Brendan Zabarauskas <
notifications@github.com> wrote:

Yack. I wonder what other name we could give it? :[


Reply to this email directly or view it on GitHub
#43 (comment).

http://octayn.net/

@bvssvni
Copy link
Contributor

bvssvni commented Jul 24, 2014

CGVector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants