summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-13/+13
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-8/+4
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-8/+4
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-9/+4
Misc cleanups
2018-07-28Auto merge of #52355 - pietroalbini:zfeature, r=eddybbors-1/+5
Add the -Zcrate-attr=foo unstable rustc option This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code. The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable. cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum
2018-07-28Don't format!() string literalsljedrz-13/+13
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-9/+9
Use a slice where a vector is not necessary
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-27Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributesPietro Albini-1/+5
2018-07-27Use slices where a vector is not necessaryljedrz-9/+9
2018-07-27SimplifyShotaro Yamada-2/+2
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-7/+3
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-24Auto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomezbors-5/+17
rustdoc: set panic output before starting compiler thread pool When the compiler was updated to run on a thread pool, rustdoc's processing of compiler/doctest stderr/stdout was moved into each compiler thread. However, this caused output of the test to be lost if the test failed at *runtime* instead of compile time. This change sets up the `set_panic` call and output bomb before starting the compiler thread pool, so that the `Drop` call that writes back to the test's stdout happens after the test runs, not just after it compiles. Fixes https://github.com/rust-lang/rust/issues/51162
2018-07-24force the doctest rustc thread to share the name of the testQuietMisdreavus-5/+17
2018-07-23dump lints _after_ parsing macrosmark-7/+9
2018-07-23Extend ParseSess to support buffering lintsmark-0/+8
2018-07-19Auto merge of #52197 - euclio:exit-code, r=oli-obkbors-13/+35
overhaul exit codes for rustc and rustdoc 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. Note that while changes were made to the rustdoc binary, there is no intended behavior change. rustdoc errors (i.e., failed lints) will still report 101. While this could *also* hide potential ICEs, I will leave that work to a future PR. Fixes #51971.
2018-07-18Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearthbors-1/+5
Lint `async` identifiers in 2018 preparation mode r? @Manishearth fixes https://github.com/rust-lang/rust/issues/49716
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-17Rollup merge of #52338 - RalfJung:miri, r=oli-obkkennytm-18/+18
update miri
2018-07-17Rollup merge of #52435 - ljedrz:misc_capacity, r=estebankkennytm-1/+2
Calculate the exact capacity for 2 HashMaps
2018-07-17Auto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakisbors-51/+53
Deny bare trait objects in librustc_driver Enforce `#![deny(bare_trait_objects)]` in `src/librustc_driver`.
2018-07-16Calculate the exact capacity for 2 HashMapsljedrz-1/+2
2018-07-16ItemKindcsmoe-18/+18
2018-07-14Lint the use of async as an identifierOliver Schneider-1/+5
2018-07-12Add missing dyn in driver.rsljedrz-1/+1
2018-07-12Deny bare trait objects in librustc_driverljedrz-50/+52
2018-07-10Auto merge of #52100 - nielx:fix/rust_driver-stacklimit, r=cramertjbors-1/+21
Haiku: work around the lack of setrlimit The default Unix codepath fails, because Haiku does not implement setrlimit for stack size. Thus we create an additional path. 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-07-07Revert changes to bootstrap, rustc_driver and fix {core,std}simdbjorn3-12/+2
2018-07-07Remove unused rustc_driver dependency on arbjorn3-2/+0
2018-07-07Move some functions out of rustc_codegen_llvm and fix metadata_only backendbjorn3-2/+12
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-07-05Do not run AST borrowck when -Zborrowck=mirSantiago Pastorino-1/+5
2018-06-30Auto merge of #51806 - oli-obk:lowering_cleanups1, r=cramertjbors-1/+1
Lowering cleanups [1/N]
2018-06-28Use `Ident`s for associated item definitions in HIRVadim Petrochenkov-1/+1
Remove emulation of hygiene with gensyms
2018-06-27Generate the `NodeId` for `existential type` in the ASTOliver Schneider-1/+1
2018-06-24Attempt to fix hygiene for global_allocatorMark Mansi-1/+10
2018-06-21Parse async fn header.Without Boats-6/+6
This is gated on edition 2018 & the `async_await` feature gate. The parser will accept `async fn` and `async unsafe fn` as fn items. Along the same lines as `const fn`, only `async unsafe fn` is permitted, not `unsafe async fn`.The parser will not accept `async` functions as trait methods. To do a little code clean up, four fields of the function type struct have been merged into the new `FnHeader` struct: constness, asyncness, unsafety, and ABI. Also, a small bug in HIR printing is fixed: it previously printed `const unsafe fn` as `unsafe const fn`, which is grammatically incorrect.
2018-06-20Rename structures in astvarkor-1/+1
2018-06-20Remove AngleBracketedArgs implvarkor-5/+11
2018-06-20Make method and variable names more consistentvarkor-1/+1
2018-06-20Rename "parameter" to "arg"varkor-1/+1
2018-06-20Rename PathParameter(s) to GenericArg(s)varkor-2/+2
2018-06-20Consolidate PathParameters and AngleBracketedParameterDatavarkor-1/+1
2018-06-19Auto merge of #51383 - Zoxc:parallel-stuff, r=nikomatsakisbors-5/+3
Run some stuff in parallel Requires https://github.com/rust-lang/rust/pull/50699 to actually work correctly. r? @nikomatsakis
2018-06-19Parallel codeJohn Kåre Alsaker-5/+3