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

Show better errors for LLVM IR output #59744

Merged
merged 1 commit into from Apr 6, 2019

Conversation

Projects
None yet
5 participants
@cuviper
Copy link
Member

commented Apr 6, 2019

I was trying to output LLVM IR directly to the console:

$ rustc hello.rs --emit=llvm-ir -o /dev/stdout
LLVM ERROR: IO failure on output stream: Bad file descriptor

Now LLVMRustPrintModule returns an error, and we print:

error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied

... which is more informative.

Show better errors for LLVM IR output
I was trying to output LLVM IR directly to the console:

    $ rustc hello.rs --emit=llvm-ir -o /dev/stdout
    LLVM ERROR: IO failure on output stream: Bad file descriptor

Now `LLVMRustPrintModule` returns an error, and we print:

    error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied

... which is more informative.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 6, 2019

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@sanxiyn

This comment has been minimized.

Copy link
Member

commented Apr 6, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2019

📌 Commit aafe2c6 has been approved by sanxiyn

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2019

⌛️ Testing commit aafe2c6 with merge 2982dbf...

bors added a commit that referenced this pull request Apr 6, 2019

Auto merge of #59744 - cuviper:output-errors, r=sanxiyn
Show better errors for LLVM IR output

I was trying to output LLVM IR directly to the console:

    $ rustc hello.rs --emit=llvm-ir -o /dev/stdout
    LLVM ERROR: IO failure on output stream: Bad file descriptor

Now `LLVMRustPrintModule` returns an error, and we print:

    error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied

... which is more informative.
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: sanxiyn
Pushing 2982dbf to master...

@bors bors added the merged-by-bors label Apr 6, 2019

@bors bors merged commit aafe2c6 into rust-lang:master Apr 6, 2019

1 check passed

homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.