Skip to content

Failed to compile some part of example from the website " rand::Rng().shuffle([1, 2, 3]) " #5053

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

Closed
cnd opened this issue Feb 20, 2013 · 3 comments
Labels
O-windows Operating system: Windows
Milestone

Comments

@cnd
Copy link
Contributor

cnd commented Feb 20, 2013

OS: Windows 7 32 bit, using MinGW version suggested by wiki (because last one just fails)

Trying to compile example from website.

description:

this code works:

use core::*;

fn main() {
    for ["Alice", "Bob", "Carol"].each |&name| {
        do task::spawn {
            io::println(name);
        }
    }
}

but when I add

let v = rand::Rng().shuffle([1, 2, 3]);

like

use core::*;

fn main() {
    for ["Alice", "Bob", "Carol"].each |&name| {
        do task::spawn {
            let v = rand::Rng().shuffle([1, 2, 3]);
            io::println(name);
        }
    }
}

it fails with error :

The procedure entry point ... rand... extension... not found in the .... dll

btw: why does rust code highlighting on github look like plain text?

@brson
Copy link
Contributor

brson commented Feb 21, 2013

This is likely a symptom of this terrible, terrible bug: #3660

The problem is that there are two sets of libraries installed, and we rely on the assumption that they are identical when configuring the $PATH environment variable, but that assumption has turned out not to be true for unknown reasons.

One possible terrible, terrible workaround is to add something like C:\Program Files (x86)\rust\bin\rustc\i686-pc-mingw\bin (verify that path on your own install) to the front of $PATH, but only when running the executable (not when running the compiler). That should dynamically load the library with the correct symbol. Alternately, you could just copy the files in that directory to C:\Program Files (x86)\rust\bin, which would make the two sets of libraries the same. It's a mess, sadly.

I'm not sure what the state of Rust syntax highlighting on GitHub is, but here is the issue: #4341.

@catamorphism
Copy link
Contributor

@cynede - let me know if what @brson suggested works for you, and if it does, I'll close this as a duplicate of #3660. If it doesn't, we'll leave it open for now.

@cnd
Copy link
Contributor Author

cnd commented Feb 22, 2013

It works, thank you.

@cnd cnd closed this as completed Feb 22, 2013
bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Allow `unused_self` lint at the function level

Another approach of rust-lang#5062.
Fixes rust-lang#5053

changelog: Allow `unused_self` lint at the function level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

3 participants