summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-1/+1
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-4/+1
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-4/+1
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-2/+2
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-8/+3
Misc cleanups
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-2/+0
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27SimplifyShotaro Yamada-1/+1
2018-07-27Use str::repeatShotaro Yamada-7/+2
2018-07-27Prefer to_string() to format!()ljedrz-2/+2
2018-07-25Improve readability in a few sortsljedrz-4/+1
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-24force the doctest rustc thread to share the name of the testQuietMisdreavus-5/+17
2018-07-18rustc: distinguish compilation failure from ICEAndy Russell-13/+35
This commit changes the exit status of rustc to 1 in the presence of compilation errors. In the event of an unexpected panic (ICE) the standard panic error exit status of 101 remains. A run-make test is added to ensure that the exit code does not regress, and compiletest is updated to check for an exit status of 1 or 101, depending on the mode and suite. This is a breaking change for custom drivers. Fixes #51971.
2018-07-12Deny bare trait objects in librustc_driverljedrz-18/+20
2018-07-06Haiku: work around the lack of setrlimitNiels Sascha Reedijk-1/+21
By default, Haiku has the desired 16 MB stack, therefore in general we do not have to spawn a new thread. The code has been written in such a way that any changes in Haiku or in Rust will be adapted to.
2018-06-28Use `Ident`s for associated item definitions in HIRVadim Petrochenkov-1/+1
Remove emulation of hygiene with gensyms
2018-06-05Impl CompilerCalls for CompileController instead of AdHocCompilerCallsbjorn3-24/+0
2018-06-05Add AdHocCalls and pass self to build_controller as Box<Self>bjorn3-22/+50
2018-05-17Add edition to expansion infoVadim Petrochenkov-1/+2
2018-05-17Rename trans to codegen everywhere.Irina Popa-36/+38
2018-05-13Add a Rayon thread poolJohn Kåre Alsaker-16/+22
2018-05-13Add Sync bounds to the crate storeJohn Kåre Alsaker-0/+2
2018-05-02make it compile againflip1995-1/+1
2018-05-02Allow Path for name of MetaItemSeiichi Uchida-1/+1
2018-04-27rustc_driver: Catch ICEs on the main thread tooJosh Stone-1/+2
2018-04-26Rename rustc_back::target to rustc_target::spec.Irina Popa-2/+2
2018-04-17Use #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD.Michael Woerister-0/+4
2018-04-17Rollup merge of #49606 - varkor:pipe-repair, r=alexcrichtonkennytm-0/+12
Prevent broken pipes causing ICEs As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this. As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion. One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](https://github.com/rust-lang/rust/issues/34376#issuecomment-377822526) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe. Fixes #34376.
2018-04-11Rollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scottmcmkennytm-8/+3
Use sort_by_cached_key where appropriate A follow-up to https://github.com/rust-lang/rust/pull/48639, converting various slice sorting calls to `sort_by_cached_key` when the key functions are more expensive.
2018-04-11Prevent EPIPE causing ICEs in rustc and rustdocvarkor-0/+12
2018-04-09Convert sort_by to sort_by_cached_keyvarkor-8/+3
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-1/+1
2018-04-04Auto merge of #48575 - ishitatsuyuki:unix-no-thread, r=alexcrichtonbors-8/+49
rustc_driver: get rid of the extra thread **Do not rollup** We can alter the stack size afterwards on Unix. Having a separate thread causes poor debugging experience when interrupting with signals. I have to get the backtrace of the all thread, as the main thread is waiting to join doing nothing else. This patch allows me to just run `bt` to get the desired backtrace.
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-24/+30
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-20Reinit the stack guard on unexpected failureTatsuyuki Ishi-3/+3
2018-03-19Address review commentsTatsuyuki Ishi-3/+5
2018-03-18rustc_driver: get rid of extra thread on WindowsTatsuyuki Ishi-1/+5
2018-03-18rustc_driver: get rid of extra thread on UnixTatsuyuki Ishi-8/+43
2018-03-17Auto merge of #48904 - Zoxc:code-and-file-maps, r=michaelwoeristerbors-2/+2
Make CodeMap and FileMap thread-safe r? @michaelwoerister
2018-03-16Always print `aborting due to n previous error(s)` and only print it once ↵John Kåre Alsaker-24/+30
for multi-threaded code
2018-03-15Require a thread-safe file loaderJohn Kåre Alsaker-2/+2
2018-03-15Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoeristerkennytm-0/+6
fix #48816 don't print help on indirect compiler ICE https://github.com/rust-lang/rust/issues/48816#issuecomment-372817573
2018-03-15Rollup merge of #48765 - Phlosioneer:10234-wall-help-message, r=estebankkennytm-0/+16
Add info message for -Wall command Users coming from other languages (namely C and C++) often expect to use a -Wall flag. Rustc doesn't support that, and previously it simply printed that it didn't recognize the "all" lint. This change makes rustc print out a help message, explaining: - Why there is no -Wall flag - How to view all the available warnings - Point out that the most commonly used warning is -Wunused - Instead of using a command-line flag, the user should consider a !#[warn(unused)] directive in the root of their crate. I tried to keep the language consistent with the other usage help. Comment if I should change anything. closes #10234, if accepted.
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-0/+11
2018-03-13fix #48816 don't print help on indirect compiler ICEAlex Butler-0/+6
2018-03-13introduce `infcx.at(..).normalize(..)` operation [VIC]Niko Matsakis-0/+1
It is backed by the new `normalize_projection_ty` query, which uses canonicalization.
2018-03-12Update -Wall message based on feedbackPhlosioneer-4/+3
The reference to -Wunused was removed, and some phrasing was changed.
2018-03-09Move PROFQ_CHAN to a Session fieldJohn Kåre Alsaker-1/+1