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

Error messages from rustc interleaved #6848

Closed
bjorn3 opened this issue Apr 14, 2019 · 0 comments · Fixed by #7450
Closed

Error messages from rustc interleaved #6848

bjorn3 opened this issue Apr 14, 2019 · 0 comments · Fixed by #7450
Assignees
Labels
A-cache-messages Area: caching of compiler messages A-console-output Area: Terminal output, colors, progress bar, etc. C-bug Category: bug

Comments

@bjorn3
Copy link
Member

bjorn3 commented Apr 14, 2019

Problem

I ran cargo test and saw:

   Compiling moria v0.1.0 (/Users/bjorn/Documents/moria)
error: expected one of `;` or `{`, found `#`
error: expected one of `;` or `{`, found `#`
  --> src/lib.rs:42:1
   |
  --> src/lib.rs:42:1
40 | mod dsym
   |
40 | mod dsym
   |         - expected one of `;` or `{` here
   |         - expected one of `;` or `{` here
41 | 
42 | #[cfg(not(target_os="macos"))]
   | ^ unexpected token

41 | 
42 | #[cfg(not(target_os="macos"))]
   | ^ unexpected token

error: aborting due to previous error

error: aborting due to previous error

error: Could not compile `moria`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `moria`.

To learn more, run the command again with --verbose.

Steps

  1. Add an error (eg syntax error) to a rust file.
  2. Run cargo test

Possible Solution(s)

Notes

Output of cargo version: cargo 1.33.0 (f099fe94b 2019-02-12)

$ uname
Darwin
@bjorn3 bjorn3 added the C-bug Category: bug label Apr 14, 2019
@ehuss ehuss self-assigned this May 6, 2019
bors added a commit that referenced this issue May 21, 2019
Add message caching.

The `cache-messages` feature causes Cargo to cache the messages generated by
the compiler. This is primarily useful if a crate compiles successfully with
warnings. Previously, re-running Cargo would not display any output. With the
`cache-messages` feature, it will quickly redisplay the previous warnings.

```
cargo +nightly check -Z cache-messages
```

Notes:
- `short` messages do not work correctly.
- rustdoc does not support `--json-rendered=termcolor`, so its output is currently uncolored.
- This approach to rendering should address some output issues like #6848.
@ehuss ehuss added A-console-output Area: Terminal output, colors, progress bar, etc. A-cache-messages Area: caching of compiler messages labels Sep 23, 2019
@bors bors closed this as completed in b03182a Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cache-messages Area: caching of compiler messages A-console-output Area: Terminal output, colors, progress bar, etc. C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants