Skip to content

Show better errors for LLVM IR output #59744

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

Merged
merged 1 commit into from
Apr 6, 2019
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper 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.

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
Copy link
Contributor

r? @oli-obk

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2019
@sanxiyn
Copy link
Member

sanxiyn commented Apr 6, 2019

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 6, 2019

📌 Commit aafe2c6 has been approved by sanxiyn

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2019
@bors
Copy link
Collaborator

bors commented Apr 6, 2019

⌛ Testing commit aafe2c6 with merge 2982dbf...

bors added a commit that referenced this pull request Apr 6, 2019
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
Copy link
Collaborator

bors commented Apr 6, 2019

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 6, 2019
@bors bors merged commit aafe2c6 into rust-lang:master Apr 6, 2019
@cuviper cuviper deleted the output-errors branch May 17, 2019 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants