about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-07-30Auto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasperbors-15/+16
[NLL] Fix some things for bootstrap Some changes that are required when bootstrapping rustc with NLL enabled. * Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch. * Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion. cc #51823
2018-07-30Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obkbors-7/+49
Tweak the raw_identifiers lints in 2018 * Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-172/+168
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-30Auto merge of #52823 - RalfJung:test, r=eddybbors-2/+21
invalid_const_promotion: check if we get the right signal r? @eddyb
2018-07-30Auto merge of #52828 - Mark-Simulacrum:clear-rustdoc-check, r=alexcrichtonbors-0/+5
Clear out rustdoc check builds if dependencies change r? @alexcrichton
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-150/+101
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-29dont hardcode vtable size in codegen testRalf Jung-2/+2
2018-07-29update codegen testsRalf Jung-2/+2
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-43/+0
2018-07-29Update miri submoduleOliver Schneider-4/+10
2018-07-29Sanity-check all constantsOliver Schneider-190/+1049
2018-07-29Change order of copy and borrow to avoid conflictMatthew Jasper-1/+2
Note that the first argument is `self as &mut dyn Delegate`, so this isn't allowed with two-phase borrows.
2018-07-29Remove unused `mut`sMatthew Jasper-14/+14
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-150/+101
2018-07-29Clear out rustdoc check builds if dependencies changeMark Rousskov-0/+5
2018-07-29Auto merge of #52620 - mikhail-m1:51351, r=nikomatsakisbors-48/+218
fix simple case of issue #51351 and #52133 r? @nikomatsakis
2018-07-29Auto merge of #52755 - kennytm:update-rustfmt, r=nrcbors-192/+242
Update rustfmt and RLS
2018-07-29invalid_const_promotion: check if we get the right signalRalf Jung-2/+21
2018-07-29Update RLS and rustfmt.kennytm-191/+232
2018-07-29Test clippy first to workaround the derive-new conflict.kennytm-1/+2
2018-07-29fix issues #51351 and #52133Mikhail Modin-48/+218
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-95/+95
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-29Exempt cloudabi from license check.kennytm-0/+1
2018-07-29Copy the test_data/ RLS tests into a writable directory.kennytm-0/+7
See rust-lang-nursery/rls#966 for details.
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-73/+50
Misc cleanups
2018-07-29Auto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomezbors-26/+50
rustdoc: rework how default passes are chosen This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do. The major changes: * There are now two sets of "default passes": one set for "no flags given" and one for "document private items". * These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes. * When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults". * I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.
2018-07-29Auto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakisbors-41/+54
Update the Cargo submodule and rustfix Should hopefully bring in a few more `cargo fix`-related fixes.
2018-07-28Auto merge of #52355 - pietroalbini:zfeature, r=eddybbors-3/+66
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-28Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavusbors-69/+246
[rustdoc] Generic impls Fixes #33772. r? @QuietMisdreavus
2018-07-28Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelixbors-22/+121
do not overwrite child def-id in place but rather remove/insert When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later. Fixes #52050 r? @aturon -- do you still remember this code at all? :)
2018-07-28Move blanket implementations generation into its own functionGuillaume Gomez-19/+29
2018-07-28Remove core exclusion conditionGuillaume Gomez-13/+13
2018-07-28Update the Cargo submodule and rustfixAlex Crichton-41/+54
Should hopefully bring in a few more `cargo fix`-related fixes.
2018-07-28Auto merge of #52744 - RalfJung:align_offset, r=Kimundibors-10/+7
make memrchr use align_offset I hope I did not screw that up... Cc @oli-obk who authored the original https://github.com/rust-lang/rust/pull/44537 Fixes #50567 (thanks @bjorn3)
2018-07-28Don't format!() string literalsljedrz-172/+168
2018-07-28Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakisbors-95/+250
Change ManuallyDrop<T> to a lang item. This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`). A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`. r? @nikomatsakis
2018-07-28Don't display full blanket implementation and put it into its own sectionGuillaume Gomez-24/+59
2018-07-28Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakisbors-7/+199
static infer feature gate https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-07-28Auto merge of #52802 - kennytm:rollup, r=kennytmbors-113/+185
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) Failed merges: r? @ghost
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-30/+30
Use a slice where a vector is not necessary
2018-07-28Rollup merge of #52779 - RalfJung:atty, r=Mark-Simulacrumkennytm-7/+7
revert accidental atty downgrade This got accidentally downgraded by https://github.com/rust-lang/rust/pull/52488 Cc @nikomatsakis @pnkfelix
2018-07-28Rollup merge of #52777 - omni-viral:master, r=TimNNkennytm-2/+2
Fix doc comment for 'ptr::copy_to' method Fix error in doc comment for `ptr::copy_to` method.
2018-07-28Rollup merge of #52769 - sinkuu:stray_test, r=alexcrichtonkennytm-19/+12
Incorporate a stray test `liballoc/repeat-generic-slice.rs` doesn't seem to be tested (I think it was intended to be placed in `run-pass`). This PR incorporates the test into `liballoc/tests`.
2018-07-28Rollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelixkennytm-9/+0
Remove unused "-Zenable_nonzeroing_move_hints" flag Removing a dead option which seems to be a remnant of the old drop-flag system.
2018-07-28Rollup merge of #52763 - petrhosek:fuchsia-triple, r=alexcrichtonkennytm-22/+22
Omit the vendor component in Fuchsia triple Previously, using unknown as the vendor value would lead to the same result, but with the multiarch runtimes support in Clang, the target is now used to locate the runtime libraries and so the format is important. The denormalized format with omitted vendor component is the format we use with Clang and should be using for Rust as well.
2018-07-28Rollup merge of #52760 - cuviper:test_loading_atoi, r=alexcrichtonkennytm-13/+12
rustc_metadata: test loading atoi instead of cos Some platforms don't actually have `libm` already linked in the test infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would fail to find the "cos" symbol. Every platform running this test should have `libc` and "atoi" though, so try to use that symbol instead. Fixes #45410.
2018-07-28Rollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNNkennytm-0/+5
Impl Send & Sync for JoinHandle This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees. Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations): ```rust impl<T: Send> Send for JoinHandle<T> {} impl<T: Sync> Sync for JoinHandle<T> {} ``` Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl? And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.
2018-07-28Rollup merge of #52740 - estebank:crate-name, r=petrochenkovkennytm-1/+69
Suggest underscore when using dashes in crate namet push fork Fix #48437.
2018-07-28Rollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakiskennytm-21/+14
Improve a few vectors - calculate capacity or build from iterators Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.
2018-07-28Rollup merge of #52702 - csmoe:mut_diff, r=estebankkennytm-0/+23
Suggest fix when encountering different mutability from impl to trait Closes https://github.com/rust-lang/rust/issues/52412 r? @estebank