Skip to content

Failure to use rusti's :load command #8392

Closed

Description

@minhnhdo

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.

Activity

  1. minhnhdo commented on Aug 8, 2013

    @minhnhdo
    Author

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

  2. minhnhdo commented on Aug 9, 2013

    @minhnhdo
    Author

    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
    
  3. added a commit that references this issue on Oct 17, 2013
    386fa1d
  4. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions