about summary refs log tree commit diff
path: root/src/tools/tidy
AgeCommit message (Collapse)AuthorLines
2024-03-11Vendor rustc_codegen_gccGuillaume Gomez-4/+1
2024-03-10Rollup merge of #121860 - mu001999:master, r=NilstriebMatthias Krüger-6/+96
Add a tidy check that checks whether the fluent slugs only appear once As ``````@Nilstrieb`````` said in https://github.com/rust-lang/rust/pull/121828#issuecomment-1972622855: > Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that there's a tidy check already for sorting We can get the tidy check error: ``` tidy check tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used ``` r? ``````@Nilstrieb``````
2024-03-09Rollup merge of #121584 - klensy:itertools-up, r=Mark-SimulacrumGuillaume Boisseau-1/+0
bump itertools to 0.12 still depend on 0.11 (temporary dupes version): * <del>clippy</del>, https://github.com/rust-lang/rust-clippy/pull/12346 * rustfmt, sigh, https://github.com/rust-lang/rustfmt/pull/6093 https://github.com/rust-itertools/itertools/blob/v0.12.1/CHANGELOG.md removed unused `derive_more` dep from `rustc_middle`
2024-03-09fix incorrect path resolution in tidyonur-ozkan-3/+4
Previously, reading the current path from the environment led to failure when invoking x from outside the source root. This change fixes this issue by passing the already resolved root path into `ui_tests::check`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-08Rollup merge of #122175 - chenyukang:yukang-fix-tidy-issues, r=workingjubileeMatthias Krüger-100/+109
Bless tidy issues order The order is not right now because of https://github.com/rust-lang/rust/pull/121248#issuecomment-1975324159 from https://github.com/rust-lang/rust/pull/122161#discussion_r1517107993 r? `@workingjubilee`
2024-03-08Rollup merge of #121194 - beetrees:rustc-raw-args, r=petrochenkovMatthias Krüger-3/+3
Refactor pre-getopts command line argument handling Rebased version of #111658. I've also fixed the Windows CI failure (although I don't have access to Windows to test it myself).
2024-03-08remove unused derive_more depklensy-1/+0
2024-03-08Bless tidy issues orderyukang-100/+109
2024-03-06Fix tidy --bless on WindowsJubilee Young-1/+5
2024-03-07Make `arg_expand_all` not short-circuit on first errorbeetrees-3/+3
2024-03-05Assert that test names cannot contain dots许杰友 Jieyou Xu (Joe)-0/+6
This is so that we can catch stray test output files, since test names without dots can form predictable patterns we can match on.
2024-03-04Use Path::file_stem instead许杰友 Jieyou Xu (Joe)-3/+1
2024-03-04Split dots in filename, not the entire path许杰友 Jieyou Xu (Joe)-7/+15
2024-03-03Move testsCaio-117/+117
2024-03-03Auto merge of #121877 - estebank:fancy-svg, r=compiler-errorsbors-0/+1
On tests that specify `--color=always` emit SVG file with stderr output Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly. <img src="https://raw.githubusercontent.com/rust-lang/rust/b4bdb56f86e136ca63bf71dca3034200c6c25900/tests/ui/error-emitter/highlighting.svg">
2024-03-02On tests that specify --color=always emit SVG file with stderr outputEsteban Kuber-0/+1
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
2024-03-03Add a tidy check that checks whether the fluent slugs only appear oncer0cky-6/+96
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+1
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-03-01Rollup merge of #121811 - ↵Matthias Krüger-3/+3
rcvalle:rust-cfi-move-ui-tests-to-sanitizer-directory, r=compiler-errors Move sanitizer ui tests to sanitizer directory Moves the sanitizer ui tests to the sanitizer directory and removes the sanitizer prefix from tests file names similarly to how the sanitizer codegen tests are organized.
2024-03-01Rollup merge of #121475 - jieyouxu:tidy-stderr-check, r=the8472,compiler-errorsMatthias Krüger-24/+202
Add tidy check for .stderr/.stdout files for non-existent test revisions Closes #77498.
2024-02-29Move sanitizer ui tests to sanitizer directoryRamon de C Valle-3/+3
Moves the sanitizer ui tests to the sanitizer directory and removes the sanitizer prefix from tests file names similarly to how the sanitizer codegen tests are organized.
2024-02-29Error on stray .stderr/.stdout files for (un-)revisioned tests许杰友 Jieyou Xu (Joe)-24/+202
2024-02-29Rollup merge of #121681 - jswrenn:nix-visibility-analysis, r=compiler-errorsMatthias Krüger-1/+0
Safe Transmute: Revise safety analysis This PR migrates `BikeshedIntrinsicFrom` to a simplified safety analysis (described [here](https://github.com/rust-lang/project-safe-transmute/issues/15)) that does not rely on analyzing the visibility of types and fields. The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis. Notably, this PR removes the `Context` type parameter from `BikeshedIntrinsicFrom`. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter. r? `@compiler-errors`
2024-02-27safe transmute: revise safety analysisJack Wrenn-1/+0
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
2024-02-24tidy: support `ignore-tidy` for Markdown filesMiguel Ojeda-1/+3
To be used to skip the `tab` check in `jobserver.md`. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-02-23rustc: Fix wasm64 metadata object filesAlex Crichton-0/+3
It looks like LLD will detect object files being either 32 or 64-bit depending on any memory present. LLD will additionally reject 32-bit objects during a 64-bit link. Previously metadata objects did not have any memories in them which led LLD to conclude they were 32-bit objects which broke 64-bit targets for wasm. This commit fixes this by ensuring that for 64-bit targets there's a memory object present to get LLD to detect it's a 64-bit target. Additionally this commit moves away from a hand-crafted wasm encoder to the `wasm-encoder` crate on crates.io as the complexity grows for the generated object file. Closes #121460
2024-02-23Auto merge of #121432 - mj10021:issue-119851-fix, r=nnethercotebors-1/+0
Move as many tests from tests/ui/numbers-arithmetic to tests/ui/lint as possible Fixes #119851 , and also consolidates as many individual tests as possible from numbers-arithmetic. I might have moved the tests in too aggressively, so let me know
2024-02-22Update tidy target_specific_tests to account for `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-02-22Update tidy target_policy to account for `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-02-22remove exceptionJames Dietz-1/+0
2024-02-21Auto merge of #121383 - Dylan-DPC:rollup-735p4u4, r=Dylan-DPCbors-1/+1
Rollup of 7 pull requests Successful merges: - #121208 (Convert `delayed_bug`s to `bug`s.) - #121288 (make rustc_expand translatable) - #121304 (Add docs for extension proc-macro) - #121328 (Make --verbose imply -Z write-long-types-to-disk=no) - #121338 (Downgrade ambiguous_wide_pointer_comparisons suggestions to MaybeIncorrect) - #121361 (diagnostic items for legacy numeric modules) - #121375 (Print proper relative path for descriptive name check) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-21print proper relative path for descriptive name checkyukang-1/+1
2024-02-20wasm: Store rlib metadata in wasm object filesAlex Crichton-0/+17
The goal of this commit is to remove warnings using LLVM tip-of-tree `wasm-ld`. In llvm/llvm-project#78658 the `wasm-ld` LLD driver no longer looks at archive indices and instead looks at all the objects in archives. Previously `lib.rmeta` files were simply raw rustc metadata bytes, not wasm objects, meaning that `wasm-ld` would emit a warning indicating so. WebAssembly targets previously passed `--fatal-warnings` to `wasm-ld` by default which meant that if Rust were to update to LLVM 18 then all wasm targets would not work. This immediate blocker was resolved in rust-lang/rust#120278 which removed `--fatal-warnings` which enabled a theoretical update to LLVM 18 for wasm targets. This current state is ok-enough for now because rustc squashes all linker output by default if it doesn't fail. This means, for example, that rustc squashes all the linker warnings coming out of `wasm-ld` about `lib.rmeta` files with LLVM 18. This again isn't a pressing issue because the information is all hidden, but it runs the risk of being annoying if another linker error were to happen and then the output would have all these unrelated warnings that couldn't be fixed. Thus, this PR comes into the picture. The goal of this PR is to resolve these warnings by using the WebAssembly object file format on wasm targets instead of using raw rustc metadata. When I first implemented the rlib-in-objects scheme in #84449 I remember either concluding that `wasm-ld` would either include the metadata in the output or I thought we didn't have to do anything there at all. I think I was wrong on both counts as `wasm-ld` does not include the metadata in the final output unless the object is referenced and we do actually need to do something to resolve these warnings. This PR updates the object file format containing rustc metadata on WebAssembly targets to be an actual WebAssembly file. This enables the `wasm` feature of the `object` crate to be able to read the custom section in the same manner as other platforms, but currently `object` doesn't support writing wasm object files so a handwritten encoder is used instead. The only caveat I know of with this is that if `wasm-ld` does indeed look at the object file then the metadata will be included in the final output. I believe the only thing that could cause that at this time is `--whole-archive` which I don't think is passed for rlibs. I would clarify that I'm not 100% certain about this, however.
2024-02-20Auto merge of #120628 - workingjubilee:reimpl-meaningful-test-name-lint, ↵bors-9/+4462
r=compiler-errors Reimpl meaningful test name lint MCP658 This reintroduces the tidy rule originally proposed in https://github.com/rust-lang/rust/pull/113583 that then became an MCP in https://github.com/rust-lang/compiler-team/issues/658 which eventually surfaced a quite-reasonable request for a diagnostic enhancement. I have added that to the rule. It produces output like this: ``` tidy error: file `ui/unsized/issue-115809.rs` must begin with a descriptive name, try `{reason}-issue-115809.rs` tidy error: file `ui/unsized/issue-115203.rs` must begin with a descriptive name, try `{reason}-issue-115203.rs` tidy error: file `ui/privacy/issue-113860-2.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs` tidy error: file `ui/privacy/issue-117997.rs` must begin with a descriptive name, try `{reason}-issue-117997.rs` tidy error: file `ui/privacy/issue-119463.rs` must begin with a descriptive name, try `{reason}-issue-119463.rs` tidy error: file `ui/privacy/auxiliary/issue-117997.rs` must begin with a descriptive name, try `{reason}-issue-117997.rs` tidy error: file `ui/privacy/auxiliary/issue-119463-extern.rs` must begin with a descriptive name, try `{reason}-issue-119463.rs` tidy error: file `ui/privacy/issue-113860-1.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs` tidy error: file `ui/privacy/issue-113860.rs` must begin with a descriptive name, try `{reason}-issue-113860.rs` tidy error: file `ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs` must begin with a descriptive name, try `{reason}-issue-114151.rs` tidy error: file `ui/did_you_mean/issue-114112.rs` must begin with a descriptive name, try `{reason}-issue-114112.rs` tidy error: file `ui/did_you_mean/issue-105225.rs` must begin with a descriptive name, try `{reason}-issue-105225.rs` tidy error: file `ui/did_you_mean/issue-105225-named-args.rs` must begin with a descriptive name, try `{reason}-issue-105225.rs` ``` You get the idea. There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like: - issue-314159265-blue.rs - issue-314159265-red.rs Starting them with `red-` and `blue-` means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be: - colored-circle-gen-blue.rs - colored-circle-gen-red.rs Deciding exactly *how* to solve this is not the business of tidy, only recognizing a what. r? `@compiler-errors`
2024-02-18Add `Future` and `IntoFuture` to the 2024 preludeNilstrieb-1/+1
Implements RFC 3509.
2024-02-18Auto merge of #121265 - klensy:bump-18-02-24, r=Mark-Simulacrumbors-0/+1
bump some deps First commit dedupes darling* crates and remove one more syn 1.* dep Second one bumps windows crate to 0.52
2024-02-18tidy: add windows-coreklensy-0/+1
2024-02-17Remove old issues.txt entries with --blessJubilee Young-124/+97
2024-02-17Implement --bless for the issues lintJubilee Young-8/+33
2024-02-17Grandfather new questionably-named testsJubilee Young-1387/+1519
~130 new entries, depending on how you count, with the rest being sorting churn.
2024-02-17Suggest pattern in meaningful test diagnosticJubilee Young-4/+4
As the reason for tidy failing the test name may seem slightly opaque, provide a suggestion on how to rename the file. There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like: issue-314159265-blue.rs issue-314159265-red.rs Starting them with `red-` and `blue-` means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be: colored-circle-gen-blue.rs colored-circle-gen-red.rs Deciding exactly how to solve this is not the business of tidy, only recognizing a what.
2024-02-17Reapply "add tidy check that forbids issue ui test filenames"Jubilee Young-6/+4329
This reverts commit 686b3debfc19f124c9c2ec8a856c06892f6086a1.
2024-02-17tidy: wrap regexes with lazy_staticklensy-4/+8
yes, once_cell better, but ... this reduces from ==31349== Total: 1,365,199,543 bytes in 4,774,213 blocks ==31349== At t-gmax: 10,975,708 bytes in 66,093 blocks ==31349== At t-end: 2,880,947 bytes in 12,332 blocks ==31349== Reads: 5,210,008,956 bytes ==31349== Writes: 1,280,920,127 bytes to ==47796== Total: 821,467,407 bytes in 3,955,595 blocks ==47796== At t-gmax: 10,976,209 bytes in 66,100 blocks ==47796== At t-end: 2,944,016 bytes in 12,490 blocks ==47796== Reads: 4,788,959,023 bytes ==47796== Writes: 975,493,639 bytes miropt-test-tools: remove regex usage this removes regex usage and slightly refactors ext stripping in one case
2024-02-16Implement infra support for migrating from `//` to `//@` ui test directives许杰友 Jieyou Xu (Joe)-2/+14
2024-02-14Rollup merge of #120893 - c410-f3r:testsssssss, r=petrochenkovGuillaume Gomez-1/+1
Move some tests r? `@petrochenkov`
2024-02-13`cargo update`clubby789-1/+3
2024-02-13Move testsCaio-1/+1
2024-02-13Bump `time` and allow new dependenciesclubby789-0/+2
2024-02-09Move some testsCaio-2/+2
2024-02-08Add new ui testsBen Kimock-1/+1