Skip to content

rustc -o <dir>/<bin> fails #16304

@mcandre

Description

@mcandre

I want my binaries to be output in a bin/ directory. But when I tell rustc to do this, it fails.

Source:

https://github.com/mcandre/mcandre/tree/736f1ab56761c0ee967b7686e027b6174bbdd007/rust/hello

Rust 0.9 says error: unable to open executable 'bin/hello'.

I upgraded my syntax (s/mod/crate/) and tried again with Rust 0.10, then 0.11.

Rust 0.10 and 0.11 don't even show an error, they silently fail.

$ cat hello.rs 
extern crate std;

use std::io::println;

fn main() {
  println("Hello World!");
}

$ make
mkdir -p bin/
rustc -o bin/hello hello.rs
bin/hello
make: bin/hello: No such file or directory
make: *** [test] Error 1

$ tree
.
├── Makefile
├── bin
└── hello.rs

1 directory, 2 files

Using rust from Homebrew, on Mac OS X 10.9.4 Mavericks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions