about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2021-08-23Auto merge of #83302 - camsteffen:write-piece-unchecked, r=dtolnaybors-15/+20
Get piece unchecked in `write` We already use specialized `zip`, but it seems like we can do a little better by not checking `pieces` length at all. `Arguments` constructors are now unsafe. So the `format_args!` expansion now includes an `unsafe` block. <details> <summary>Local Bench Diff</summary> ```text name before ns/iter after ns/iter diff ns/iter diff % speedup fmt::write_str_macro1 22,967 19,718 -3,249 -14.15% x 1.16 fmt::write_str_macro2 35,527 32,654 -2,873 -8.09% x 1.09 fmt::write_str_macro_debug 571,953 575,973 4,020 0.70% x 0.99 fmt::write_str_ref 9,579 9,459 -120 -1.25% x 1.01 fmt::write_str_value 9,573 9,572 -1 -0.01% x 1.00 fmt::write_u128_max 176 173 -3 -1.70% x 1.02 fmt::write_u128_min 138 134 -4 -2.90% x 1.03 fmt::write_u64_max 139 136 -3 -2.16% x 1.02 fmt::write_u64_min 129 135 6 4.65% x 0.96 fmt::write_vec_macro1 24,401 22,273 -2,128 -8.72% x 1.10 fmt::write_vec_macro2 37,096 35,602 -1,494 -4.03% x 1.04 fmt::write_vec_macro_debug 588,291 589,575 1,284 0.22% x 1.00 fmt::write_vec_ref 9,568 9,732 164 1.71% x 0.98 fmt::write_vec_value 9,516 9,625 109 1.15% x 0.99 ``` </details>
2021-08-23Rollup merge of #88230 - steffahn:a_an, r=oli-obkMara Bos-20/+20
Fix typos “a”→“an” Fix typos in comments; found using a regex to find some easy instance of incorrect usage of a vs. an. While automation was used to find these, every change was checked manually. Changes in submodules get separate PRs: * https://github.com/rust-lang/stdarch/pull/1201 * https://github.com/rust-lang/cargo/pull/9821 * https://github.com/rust-lang/miri/pull/1874 * https://github.com/rust-lang/rls/pull/1746 * https://github.com/rust-analyzer/rust-analyzer/pull/9984 _folks @ rust-analyzer are fast at merging…_ * https://github.com/rust-analyzer/rust-analyzer/pull/9985 * https://github.com/rust-analyzer/rust-analyzer/pull/9987 * https://github.com/rust-analyzer/rust-analyzer/pull/9989 _For `clippy`, I don’t know if the changes should better better be moved to a PR to the original repo._ <hr> This has some overlap with #88226, but neither is a strict superset of the other. If you want multiple commits, I can split it up; in that case, make sure to suggest a criterion for splitting.
2021-08-23Rollup merge of #88188 - GuillaumeGomez:rustdoc-gui-parallel-limit, r=dns2utf8Mara Bos-10/+18
Greatly improve limitation handling on parallel rustdoc GUI test run Follow-up of https://github.com/rust-lang/rust/pull/88082. r? `@dns2utf8`
2021-08-23Greatly improve limitation handling on parallel rustdoc GUI test runGuillaume Gomez-10/+18
2021-08-23:arrow_up: rust-analyzerLaurențiu Nicola-17/+20
2021-08-22Rollup merge of #88211 - petrochenkov:withhilo, r=jyn514Guillaume Gomez-3/+3
cleanup: `Span::new` -> `Span::with_lo` Extracted from https://github.com/rust-lang/rust/pull/84373 as suggested in https://github.com/rust-lang/rust/pull/84373#issuecomment-857773867. It turned out less useful then I expected, but anyway. r? `@cjgillot` `@bors` rollup
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-6/+6
same search
2021-08-22Fix more “a”/“an” typosFrank Steffahn-3/+3
2021-08-22Fix more “a”/“an” typosFrank Steffahn-1/+1
2021-08-22Fix typos “a”→“an”Frank Steffahn-10/+10
2021-08-22Auto merge of #88163 - camsteffen:collapsible-match-fix, r=Manishearthbors-150/+136
Fix clippy::collapsible_match with let expressions This fixes rust-lang/rust-clippy#7575 which is a regression from #80357. I am fixing the bug here instead of in the clippy repo (if that's okay) because a) the regression has not been synced yet and b) I would like to land the fix on nightly asap. The fix is basically to re-generalize `match` and `if let` for the lint implementation (they were split because `if let` no longer desugars to `match` in the HIR). Also fixes rust-lang/rust-clippy#7586 and fixes rust-lang/rust-clippy#7591 cc `@rust-lang/clippy` `@xFrednet` do you want to review this?
2021-08-21Rollup merge of #87604 - yaymukund:verify-backported-commits, r=Mark-SimulacrumJack Huey-0/+34
CI: Verify commits in beta & stable are in upstream branches. Closes #74721 I think this does the trick. https://github.com/rust-lang/rust/pull/87597 is an example of it failing as it should.
2021-08-21cleanup: `Span::new` -> `Span::with_lo`Vadim Petrochenkov-3/+3
2021-08-21Auto merge of #88073 - lnicola:rust-analyzer-2021-08-16, r=lnicolabors-37/+17
:arrow_up: rust-analyzer
2021-08-20Add cherry-pick.sh convenience script.Mukund Lakshman-0/+34
2021-08-19introduce a Coerce predicateNiko Matsakis-0/+3
2021-08-19Fix clippy let expressions falloutCameron Steffen-150/+136
2021-08-18Rollup merge of #88082 - GuillaumeGomez:rustdoc-gui-jobs-opt, r=dns2utf8Guillaume Gomez-3/+21
Take into account jobs number for rustdoc GUI tests Fixes #88054. r? `@Mark-Simulacrum`
2021-08-18Auto merge of #88127 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 8 commits in b51439fd8b505d4800a257acfecf3c69f81e35cf..e96bdb0c3d0a418e7fcd7fbd69be08abf830b4bc 2021-08-09 18:40:05 +0000 to 2021-08-17 22:58:47 +0000 - Support using rustbot to ping the Windows group (rust-lang/cargo#9802) - Show information about abnormal `fix` errors. (rust-lang/cargo#9799) - Bump jobserver. (rust-lang/cargo#9798) - Render build-std web links as hyperlinks (rust-lang/cargo#9795) - Teach cargo to failfast on recursive/corecursive aliases (rust-lang/cargo#9791) - Fix value-after-table error with profiles. (rust-lang/cargo#9789) - Fix plugin registrar change. (rust-lang/cargo#9790) - Ability to specify the output name for a bin target different from the crate name (rust-lang/cargo#9627)
2021-08-18remove box_syntax uses from cranelift and toolsMarcel Hellwig-248/+247
2021-08-17Update cargoEric Huss-0/+0
2021-08-17Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrumbors-4/+4
Document private items for rustfmt This is possible now that https://github.com/rust-lang/rust/pull/73936 has been merged.
2021-08-16Fix double output of the summary lineStefan Schindler-2/+7
2021-08-16Take into account jobs number for rustdoc gui testsGuillaume Gomez-3/+21
2021-08-16clippy: Fix format_args expansion parsingCameron Steffen-15/+20
2021-08-16Auto merge of #84039 - jyn514:uplift-atomic-ordering, r=wesleywiserbors-1425/+10
Uplift the invalid_atomic_ordering lint from clippy to rustc This is mostly just a rebase of https://github.com/rust-lang/rust/pull/79654; I've copy/pasted the text from that PR below. r? `@lcnr` since you reviewed the last one, but feel free to reassign. --- This is an implementation of https://github.com/rust-lang/compiler-team/issues/390. As mentioned, in general this turns an unconditional runtime panic into a (compile time) lint failure. It has no false positives, and the only false negatives I'm aware of are if `Ordering` isn't specified directly and is comes from an argument/constant/whatever. As a result of it having no false positives, and the alternative always being strictly wrong, it's on as deny by default. This seems right. In the [zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Uplift.20the.20.60invalid_atomic_ordering.60.20lint.20from.20clippy/near/218483957) `@joshtriplett` suggested that lang team should FCP this before landing it. Perhaps libs team cares too? --- Some notes on the code for reviewers / others below ## Changes from clippy The code is changed from [the implementation in clippy](https://github.com/rust-lang/rust-clippy/blob/68cf94f6a66e47234e3adefc6dfbe806cd6ad164/clippy_lints/src/atomic_ordering.rs) in the following ways: 1. Uses `Symbols` and `rustc_diagnostic_item`s instead of string literals. - It's possible I should have just invoked Symbol::intern for some of these instead? Seems better to use symbol, but it did require adding several. 2. The functions are moved to static methods inside the lint struct, as a way to namespace them. - There's a lot of other code in that file — which I picked as the location for this lint because `@jyn514` told me that seemed reasonable. 3. Supports unstable AtomicU128/AtomicI128. - I did this because it was almost easier to support them than not — not supporting them would have (ideally) required finding a way not to give them a `rustc_diagnostic_item`, which would have complicated an already big macro. - These don't have tests since I wasn't sure if/how I should make tests conditional on whether or not the target has the atomic... This is to a certain extent an issue of 64bit atomics too, but 128-bit atomics are much less common. Regardless, the existing tests should be *more* than thorough enough here. 4. Minor changes like: - grammar tweaks ("loads cannot have `Release` **and** `AcqRel` ordering" => "loads cannot have `Release` **or** `AcqRel` ordering") - function renames (`match_ordering_def_path` => `matches_ordering_def_path`), - avoiding clippy-specific helper methods that don't exist in rustc_lint and didn't seem worth adding for this case (for example `cx.struct_span_lint` vs clippy's `span_lint_and_help` helper). ## Potential issues (This is just about the code in this PR, not conceptual issues with the lint or anything) 1. I'm not sure if I should have used a diagnostic item for `Ordering` and its variants (I couldn't figure out how really, so if I should do this some pointers would be appreciated). - It seems possible that failing to do this might possibly mean there are more cases this lint would miss, but I don't really know how `match_def_path` works and if it has any pitfalls like that, so maybe not. 2. I *think* I deprecated the lint in clippy (CC `@flip1995` who asked to be notified about clippy changes in the future in [this comment](https://github.com/rust-lang/rust/pull/75671#issuecomment-718731659)) but I'm not sure if I need to do anything else there. - I'm kind of hoping CI will catch if I missed anything, since `x.py test src/tools/clippy` fails with a lot of errors with and without my changes (and is probably a nonsense command regardless). Running `cargo test` from src/tools/clippy also fails with unrelated errors that seem like refactorings that didnt update clippy? So, honestly no clue. 3. I wasn't sure if the description/example I gave good. Hopefully it is. The example is less thorough than the one from clippy here: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_atomic_ordering. Let me know if/how I should change it if it needs changing. 4. It pulls in the `if_chain` crate. This crate was already used in clippy, and seems like it's used elsewhere in rustc, but I'm willing to rewrite it to not use this if needed (I'd prefer not to, all things being equal).
2021-08-16:arrow_up: rust-analyzerLaurențiu Nicola-37/+17
2021-08-16Uplift the `invalid_atomic_ordering` lint from clippy to rustcThom Chiovoloni-1425/+10
- Deprecate clippy::invalid_atomic_ordering - Use rustc_diagnostic_item for the orderings in the invalid_atomic_ordering lint - Reduce code duplication - Give up on making enum variants diagnostic items and just look for `Ordering` instead I ran into tons of trouble with this because apparently the change to store HIR attrs in a side table also gave the DefIds of the constructor instead of the variant itself. So I had to change `matches_ordering` to also check the grandparent of the defid as well. - Rename `atomic_ordering_x` symbols to just the name of the variant - Fix typos in checks - there were a few places that said "may not be Release" in the diagnostic but actually checked for SeqCst in the lint. - Make constant items const - Use fewer diagnostic items - Only look at arguments after making sure the method matches This prevents an ICE when there aren't enough arguments. - Ignore trait methods - Only check Ctors instead of going through `qpath_res` The functions take values, so this couldn't ever be anything else. - Add if_chain to allowed dependencies - Fix grammar - Remove unnecessary allow
2021-08-16Document private items for rustfmtJoshua Nelson-4/+4
This is possible now that rustdoc allows passing `--document-private-items` more than once.
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-670/+1044
2021-08-15Auto merge of #86692 - dns2utf8:parallelize_rustdoc-gui_tests, r=GuillaumeGomezbors-13/+113
Run rustdoc-gui tests in parallel I hid the passing tests and only show the failed ones in alphabetical order: ![image](https://user-images.githubusercontent.com/739070/123663020-84e63100-d825-11eb-9b35-0a8c30cd219c.png) Also this PR cuts down the execution time from ~40 to ~9 seconds
2021-08-14More spacing between the different blocks of resultsStefan Schindler-10/+17
2021-08-14Implement a finish method for the status_bar and some cleanupStefan Schindler-5/+11
2021-08-14Auto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obkbors-5/+5
Try filtering out non-const impls when we expect const impls **TL;DR**: Associated types on const impls are now bounded; we now disallow calling a const function with bounds when the specified type param only has a non-const impl. r? `@oli-obk`
2021-08-14Auto merge of #87600 - JohnTitor:classify-ui-tests, r=petrochenkovbors-1/+1
Move some UI tests to more suitable subdirs The classifui result: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427/e06c42226c6038da91e403c33b9947843420cf44 Some notes: - backtrace-debuginfo.rs: previously I skipped this, I'm still not sure what the best dir is. Any ideas? - estr-subtyping.rs: Seems a quite old test so removed, shouldn't? - deref-suggestion.rs: moved to inference as `suggestions` is not an ideal dir. - issue-43023.rs: a bit misclassified, moved to `derives` cc #73494 r? `@petrochenkov`
2021-08-13move Constness into TraitPredicateDeadbeef-5/+5
2021-08-13Auto merge of #87954 - flip1995:clippyup, r=Manishearthbors-375/+1311
Update Clippy r? `@Manishearth`
2021-08-12Rollup merge of #87941 - GuillaumeGomez:fix-rustdoc-js-tool, r=notriddleGuillaume Gomez-14/+19
Fix/improve rustdoc-js tool This tool is run when testing `src/test/rustdoc-js*`. r? `@notriddle`
2021-08-12Rollup merge of #87885 - m-ou-se:edition-guide-links, r=rylevGuillaume Gomez-3/+3
Link to edition guide instead of issues for 2021 lints. This changes the 2021 lints to not link to github issues, but to the edition guide instead. Fixes #86996
2021-08-12Merge commit '7bfc26ec8e7a454786668e7e52ffe527fc649735' into clippyupflip1995-375/+1311
2021-08-12Bless clippy tests.Mara Bos-3/+3
2021-08-12Rollup merge of #87928 - ehuss:update-cargo, r=ehussYuki Okushi-0/+0
Update cargo 9 commits in cc17afbb0067b1f57d8882640f63b2168d5b7624..b51439fd8b505d4800a257acfecf3c69f81e35cf 2021-08-02 20:28:08 +0000 to 2021-08-09 18:40:05 +0000 - Deduplicate entries in cargo --list (rust-lang/cargo#9773) - Include aliases with other commands (rust-lang/cargo#9764) - Add a profile option to select the codegen backend (rust-lang/cargo#9118) - remove useless conversions (rust-lang/cargo#9617) - collapse nested if blocks (rust-lang/cargo#9613) - Refactor fake_file() away from cargo_command tests (rust-lang/cargo#9767) - Update cargo-platform to 0.1.2 (rust-lang/cargo#9762) - Bump to the latest jobserver dependency (rust-lang/cargo#9760) - Fix semver check for rust 1.54.0 (rust-lang/cargo#9763)
2021-08-12Rollup merge of #87878 - lnicola:rust-analyzer-2021-08-09, r=lnicolaYuki Okushi-16/+37
:arrow_up: rust-analyzer
2021-08-11Fix rustdoc-js tool string "parsing"Guillaume Gomez-14/+19
Improve tool: add support for multiline comments
2021-08-11update clippyEsteban Kuber-906/+961
2021-08-10Update cargoEric Huss-0/+0
2021-08-10Move some UI tests to more suitable subdirsYuki Okushi-1/+1
2021-08-10Implement summarised resultsStefan Schindler-37/+54
2021-08-10Switch to stderr for failed testsStefan Schindler-1/+1
2021-08-10Review by @GuillaumeGomezStefan Schindler-11/+4
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>