Skip to content

Failure to use rusti's :load command #8392

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
minhnhdo opened this issue Aug 8, 2013 · 2 comments · Fixed by #9897
Closed

Failure to use rusti's :load command #8392

minhnhdo opened this issue Aug 8, 2013 · 2 comments · Fixed by #9897

Comments

@minhnhdo
Copy link
Contributor

minhnhdo commented Aug 8, 2013

error log

WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> :load fact
compiling fact.rs...
warning: missing crate link meta `name`, using `fact` as default
warning: missing crate link meta `vers`, using `0.0` as default
pushed .
crates loaded: fact
rusti> fact::factorial(12)
<anon>:5:12: 5:28 error: can't find crate for `fact`
<anon>:5             extern mod fact;
                     ^~~~~~~~~~~~~~~~
task <unnamed> failed at 'explicit failure', /home/minh/Documents/Workplace/rust/rust/src/libsyntax/diagnostic.rs:69
rusti>

content of fact.rs

fn factorial(n: uint) -> uint {
    let mut r = 1;
    for i in range(2, n) {
        r *= i;
    }
    r
}

After running the above section, a file named fact.o is created.

@minhnhdo
Copy link
Contributor Author

minhnhdo commented Aug 8, 2013

I'd love to work on fixing this if you guys are short on man power.

@minhnhdo
Copy link
Contributor Author

minhnhdo commented Aug 9, 2013

when I manually compile fact.rs using rustc --lib fact.rs, resulting in a libfact-<hash>-0.0.so file, and then :load fact in rusti, rusti can find the library but it dumps core after I call fact::factorial(12)

output

WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> :load fact
crates loaded: fact
rusti> fact::factorial(12)
[1]    8330 abort (core dumped)  rusti

bors added a commit that referenced this issue Oct 17, 2013
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038
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

Successfully merging a pull request may close this issue.

1 participant