| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Fix double panic when printing query stack during an ICE
On the latest nightly, any call to `bug` or `span_bug` will result in two panics - the first one as a normal result of calling `bug` / `span_bug`, and the second as a result of trying to print the query stack from the panic handler. This is caused by the query-printing code attempting to acquire a lock on `HandlerInnder`, which is still being held by `bug`.
This PR moves the actual panic out of `HandlerInner`, into `Handler`. This allows us to release the lock on `HandlerInner` before triggering the panic, ensuring that the panic handler will be able to acquire the lock if necessary.
|
|
Upgrade env_logger to 0.7
`./x.py test` passed locally.
|
|
|
|
|
|
|
|
When the panic handler is run, the existing Handler may be in a weird
state if it was responsible for triggering the panic. By using a freshly
created Handler, we avoid trying to re-entrantly lock a HandlerInner,
which was causing a double panic on ICEs.
|
|
|
|
|
|
|
|
Refactor librustc_errors::Handler API
This should be reviewed by-commit.
The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
|
|
Print out more information for `-Zunpretty=expanded,hygiene`
I've found this helpful when trying to understand how hygiene works.
Closes #16420
|
|
|
|
|
|
|
|
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given
Fixes #64339.
|
|
Fixes #64339.
|
|
Use `panic::set_hook` to print the ICE message
This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker.
ICE messages are printed in a slightly different order now. Nightly prints:
```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu
```
After this PR, rustc prints:
```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
```
|
|
Upgrade env_logger to 0.6
|
|
Migrate internal diagnostic registration to macro_rules
Review is best done commit-by-commit.
Fixes #64132.
|
|
|
|
No new code should be using it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=Mark-Simulacrum
Run doctests via out-of-process rustc
closes #63638
|
|
Strip code to the left and right in diagnostics for long lines
Fix #62999.
|
|
|
|
rustc: implement argsfiles for command line
Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line. This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`.
See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters.
This is useful for very large command lines, or when command lines are being generated into files by other tooling.
|
|
|
|
This will make @path work with miri and other non-standard entrypoints.
Also since this simplifies librustc_driver::args, move it into a simple source file. Also
remove the tests since they're doing nothing more than checking `str::lines` has the right
behaviour.
|
|
It was accidentally removed in a rebase of https://github.com/rust-lang/rust/pull/62727
Fixes https://github.com/rust-lang/rust/issues/63729
|
|
This makes `rustc` support `@path` arguments on the command line. The `path` is opened and the file is interpreted
as new command line options which are logically inserted at that point in the command-line. The options in the file
are one per line. The file is UTF-8 encoded, and may have either Unix or Windows line endings.
It does not support recursive use of `@path`.
This is useful for very large command lines, or when command-lines are being generated into files by other tooling.
|
|
It was getting a bit awkward.
|
|
CC https://github.com/rust-lang/rust/pull/59800
https://github.com/rust-lang/rust/commit/7198687bb2df13a3298ef1e8f594753073d6b9e8
Fix https://github.com/rust-lang/rust/issues/62717
|
|
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
|
|
These weren't removed by ccbcc720a679ae76155a8 most likely by accident,
let's clean them up now.
|
|
|
|
rustbuild
Remove some random unnecessary lint `allow`s
|
|
Move `source_uitil` macros into `syntax_ext`
Cleanup dependencies of `rustc_driver`
|
|
Turn `#[global_allocator]` into a regular attribute macro
It was a 99% macro with exception of some diagnostic details.
As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks.
Fixes https://github.com/rust-lang/rust/issues/44113
Fixes https://github.com/rust-lang/rust/issues/58072
|
|
cleanup: Remove `extern crate serialize as rustc_serialize`s
|
|
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
|
|
|