summary refs log tree commit diff
path: root/src/tools/tidy
AgeCommit message (Collapse)AuthorLines
2023-01-20Rollup merge of #107124 - DebugSteven:check-macro-expansion, r=albertlarsan68Michael Goulet-1/+1
fix check macro expansion If the only argument to `check!` is the module name I get this error: ``` error: expected expression, found `,` --> src/tools/tidy/src/main.rs:63:42 | 57 | / macro_rules! check { 58 | | ($p:ident $(, $args:expr)* ) => { 59 | | drain_handles(&mut handles); 60 | | ... | 63 | | $p::check($($args),* , &mut flag); | | ^ expected expression ... | 69 | | } 70 | | } | |_________- in this expansion of `check!` ... 117 | check!(hey); | ----------- in this macro invocation ``` This change makes it so commas are added only when there are `args`. r? ```@albertlarsan68```
2023-01-20Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68Michael Goulet-0/+72
check for x version updates This PR adds a check to tidy to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It checks the installed version of `x` by parsing the output of `cargo install --list` (as an option proposed in this [issue](https://github.com/rust-lang/rust/issues/106469)). It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
2023-01-20remove leading comma when there are no args in check macro expansionDebugSteven-1/+1
2023-01-20run cargo install to check for x installation and versionDebugSteven-0/+72
2023-01-19Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errorsGuillaume Gomez-2/+1
document + UI test `E0208` and make its output more user-friendly Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it. r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off. Part of https://github.com/rust-lang/rust/issues/61137.
2023-01-18remove error code from `#[rustc_variance]` and document its remainsEzra Shaw-2/+1
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-0/+20
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Skip tidy style checks for `rustc_apfloat`Maybe Waffle-0/+4
2023-01-17Add a tidy check to check for ". \w"Maybe Waffle-0/+16
2023-01-15Rollup merge of #106888 - GuillaumeGomez:tidy-gui-test, r=notriddleMatthias Krüger-0/+35
Add tidy check to ensure that rustdoc GUI tests start with a small description The first commit comes from https://github.com/rust-lang/rust/pull/106865 to prevent CI to fail. This PR adds a tidy check to enforce having a small description at the top of the GUI test. Although the format is made to be as easy as possible to read, it's not always obvious what a test is actually checking. I think enforcing this will make it easier for us to come back on these tests if needed. r? `@notriddle`
2023-01-15Add tidy check to ensure that rustdoc GUI tests start with a small descriptionGuillaume Gomez-0/+35
2023-01-14Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-SimulacrumMatthias Krüger-103/+66
tidy: Don't include wasm32 in compiler dependency check This changes the tidy compiler dependency check so that it does not include wasm32-unknown-unknown dependencies in the PERMITTED_RUSTC_DEPENDENCIES. This just helps keep the list cleaner under the assumption that the compiler will never work on wasm32-unknown-unknown. This also fixes a bug in the check to verify there are no unused dependencies in the PERMITTED_RUSTC_DEPENDENCIES. Previously the check was verifying that the dependency was used *anywhere* in the workspace, when it should have been checking if it was used for the compiler. There's also just a little general cleanup here. For example, the old `normal_deps_of_r` function was changed a while ago to return *all* dependencies, but the function name and description wasn't updated to remove `normal_`.
2023-01-14Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-SimulacrumYuki Okushi-1/+1
Remove duplicate sha-1 dependency [`sha-1`](https://crates.io/crates/sha-1) is more or less a duplicate of [`sha1`](https://crates.io/crates/sha1). The `sha-1` is deprecated and no longer updated. This updates the dependencies to use the new name. Some other dependencies that got updated as a consequence: * The updated pest dependencies are currently only used by mdbook, and shouldn't have any issues. * ucd-trie 0.1.3 to 0.1.5: No changelog, but looks like some tables were updated for new unicode versions: https://github.com/BurntSushi/ucd-generate/commits/master/ucd-trie. This is only used by pest (and thus mdbook). * thiserror 1.33 to 1.38: Nothing significant in the notes at https://github.com/dtolnay/thiserror/releases.
2023-01-12Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwconils-4/+2
remove unreachable error code `E0490` AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker. cc ``@GuillaumeGomez`` #61137
2023-01-12Rollup merge of #106733 - DebugSteven:revert-104552-warn-newer-x, r=jyn514Matthias Krüger-70/+1
Revert "warn newer available version of the x tool" Reverts rust-lang/rust#104552 Running the x executable directly created an [issue](https://github.com/rust-lang/rust/issues/106469) here. There are other options for warning a user that a newer version of x exists in the issue's discussion as well. r? `@jyn514`
2023-01-12remove unreachable error code `E0490`Ezra Shaw-4/+2
2023-01-11Deny having src/test exisiting in tidyAlbert Larsan-0/+17
2023-01-11Revert "warn newer available version of the x tool"J Haigh-70/+1
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-33/+47
2023-01-10Remove duplicate sha-1 dependencyEric Huss-1/+1
2023-01-09Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomezfee1-dead-1/+7
error-code docs improvements (No. 2) - Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord. - Wrote docs and UI test for `E0711`, again with the header. - `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though. r? ```@GuillaumeGomez```
2023-01-09fix: fix CI errorsEzra Shaw-1/+7
2023-01-08Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-SimulacrumMichael Goulet-2/+11
Add goml scripts to tidy checks r? ``@notriddle``
2023-01-08Add goml scripts to tidy checksGuillaume Gomez-2/+11
2023-01-08Rollup merge of #106580 - Ezrashaw:remove-e0313, r=compiler-errorsYuki Okushi-2/+2
remove unreachable error code `E0313` Fixes #103742 Makes #103433 redundant Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing? Also removed a redundant `// ignore-tidy-filelength` that I found while reading code. cc ``@GuillaumeGomez`` #61137
2023-01-08Rollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomezYuki Okushi-12/+15
Add some UI tests and reword error-code docs Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit. I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously. r? ``@GuillaumeGomez``
2023-01-08remove unreachable error code `E0313`Ezra Shaw-2/+2
2023-01-08Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrumbors-1/+0
Update `rand` in the stdlib tests, and remove the `getrandom` feature from it. The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones. ~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now. For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy". Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature). See also some previous attempts: - https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial) - https://github.com/rust-lang/rust/pull/89131 - https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal). - https://github.com/rust-lang/rust/pull/104185 - Probably more. It's very tempting of a thing to "just update". r? `@Mark-Simulacrum`
2023-01-07minor fixes for `error_codes.rs` tidy checkEzra Shaw-12/+15
2023-01-06Rollup merge of #106341 - Ezrashaw:refactor-error-code-tidy-check, ↵Matthias Krüger-386/+384
r=mejrs,klensy,GuillaumeGomez refactor: clean up `errors.rs` and `error_codes_check.rs` `errors.rs` is basically unused now, `error_codes_check.rs` is useful but not well commented, etc. It also doesn't check certain things which are certainly not correct. For example, `E0505` has a UI test in `src/test/ui/error-codes/` but that test actually outputs `E0504`?! Other issues like these exist. I've implemented these with "warnings" which are a bit rough around the edges but should be removed eventually. r? `@GuillaumeGomez` (again not sure if you want to review but its relevant to you)
2023-01-04Update rand in the stdlib tests, and remove the getrandom feature from itThom Chiovoloni-1/+0
2023-01-04Rollup merge of #106460 - c410-f3r:moar-errors, r=compiler-errorsMatthias Krüger-1/+1
Move tests r? `@petrochenkov`
2023-01-04tidy: Don't include wasm32 in compiler dependency checkEric Huss-103/+66
2023-01-04Move testsCaio-1/+1
2023-01-04Update cargoWeihang Lo-0/+12
8 commits in 2381cbdb4e9b07090f552d34a44a529b6e620e44..8c460b2237a6359a7e3335890db8da049bdd62fc 2022-12-23 12:19:27 +0000 to 2023-01-04 14:30:01 +0000 - test: revive nightly plugin tests to work (rust-lang/cargo#11534) - Add note to release notes about rejecting multiple registries. (rust-lang/cargo#11531) - Fix a typo `fresheness` -> `freshness` (rust-lang/cargo#11529) - Reasons for rebuilding (rust-lang/cargo#11407) - Asymmetric tokens (rust-lang/cargo#10771) - Use proper git URL for GitHub repos (rust-lang/cargo#11517) - Add `registry.default` example (rust-lang/cargo#11516) - Support vendoring with different revs from same git repo (rust-lang/cargo#10690) Also update license exceptions and permitted dependencies for new cargo dependency "pasetors". A new dependency `getrandom` is added into `rustc-workspace-hacks`, since it requires feature `js`.
2023-01-04Rollup merge of #106327 - gimbles:dbg, r=jyn514Matthias Krüger-0/+17
Add tidy check for dbg Fixes #106169
2023-01-03Rollup merge of #104552 - DebugSteven:warn-newer-x, r=jyn514Matthias Krüger-1/+70
warn newer available version of the x tool This PR adds a check to `tidy` to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It adds a `--wrapper-version` argument to `x` to determine the version at runtime, . It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
2023-01-02no_depsJ Haigh-0/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2023-01-02use cargo_metadata to get x versionDebugSteven-28/+11
2023-01-02get latest x version from parsing cargo commandDebugSteven-10/+39
2023-01-03print highest error codeEzra Shaw-0/+1
2023-01-02fix CIEzra Shaw-7/+8
2023-01-02pattern destructure `has_test`Ezra Shaw-3/+1
Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
2023-01-01Implement fix for #67535Troy Neubauer-1/+1
2023-01-01improve error messageJ Haigh-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2023-01-01fix typoJ Haigh-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2023-01-01combine error branchesDebugSteven-3/+1
2023-01-02fixup warningsEzra Shaw-72/+53
2023-01-01fix formattingDebugSteven-4/+8
2023-01-02fix CI errorEzra Shaw-2/+3