about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-03-06compiletest: Add a `//@ needs-threads` directiveAlex Crichton-0/+35
This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-03-06Auto merge of #121956 - ChrisDenton:srwlock, r=joboetbors-0/+21
Windows: Implement condvar, mutex and rwlock using futex Well, the Windows equivalent: [`WaitOnAddress`,](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress) [`WakeByAddressSingle`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddresssingle) and [`WakeByAddressAll`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddressall). Note that Windows flavoured futexes can be different sizes (1, 2, 4 or 8 bytes). I took advantage of that in the `Mutex` implementation. I also edited the Mutex implementation a bit more than necessary. I was having trouble keeping in my head what 0, 1 and 2 meant so I replaced them with consts. I *think* we're maybe spinning a bit much. `WaitOnAddress` seems to be looping quite a bit too. But for now I've keep the implementations the same. I do wonder if it'd be worth reducing or removing our spinning on Windows. This also adds a new shim to miri, because of course it does. Fixes #121949
2024-03-06Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgrbors-49/+31
Rollup of 8 pull requests Successful merges: - #121202 (Limit the number of names and values in check-cfg diagnostics) - #121301 (errors: share `SilentEmitter` between rustc and rustfmt) - #121658 (Hint user to update nightly on ICEs produced from outdated nightly) - #121846 (only compare ambiguity item that have hard error) - #121961 (add test for #78894 #71450) - #121975 (hir_analysis: enums return `None` in `find_field`) - #121978 (Fix duplicated path in the "not found dylib" error) - #121991 (Merge impl_trait_in_assoc_types_defined_by query back into `opaque_types_defined_by`) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-05Rollup merge of #121301 - davidtwco:rustfmt-silent-emitter, r=pnkfelixMatthias Krüger-49/+31
errors: share `SilentEmitter` between rustc and rustfmt Fixes rust-lang/rustfmt#6082. Shares the `SilentEmitter` between rustc and rustfmt, and gives it a fallback bundle (since it can emit diagnostics in some contexts).
2024-03-05Convert `TypeVisitor` and `DefIdVisitor` to use `VisitorResult`Jason Newcomb-7/+7
2024-03-05Auto merge of #121992 - jieyouxu:fix-tidy-unpaired-revision, r=onur-ozkanbors-7/+19
tidy: split dots in filename not the entire path when checking for stray stdout/stderr files I committed a path crime by splitting the entire path on `.`, when I meant to split on the filename. This means that any parent folders which contain `.` will cause tidy failure. Added a regression test so that doesn't happen again. ### Follow-up - [ ] Adjust rustc-dev-guide to document assert on test name not containing dots. https://github.com/rust-lang/rustc-dev-guide/pull/1927 Fixes #121986.
2024-03-05errors: share `SilentEmitter` between rustc and rustfmtDavid Wood-49/+31
Signed-off-by: David Wood <david@davidtw.co>
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-05Auto merge of #121780 - nnethercote:diag-renaming2, r=davidtwcobors-10/+15
Diagnostic renaming 2 A sequel to #121489. r? `@davidtwco`
2024-03-05Rename `DiagnosticExt` as `DiagExt`.Nicholas Nethercote-4/+4
2024-03-05Rename `DiagnosticMessage` as `DiagMessage`.Nicholas Nethercote-6/+11
2024-03-05Windows: Implement mutex using futexChris Denton-0/+21
Well, the Windows equivalent: `WaitOnAddress`, `WakeByAddressSingle` and `WakeByAddressAll`.
2024-03-05Auto merge of #120675 - oli-obk:intrinsics3.0, r=pnkfelixbors-1/+1
Add a scheme for moving away from `extern "rust-intrinsic"` entirely All `rust-intrinsic`s can become free functions now, either with a fallback body, or with a dummy body and an attribute, requiring backends to actually implement the intrinsic. This PR demonstrates the dummy-body scheme with the `vtable_size` intrinsic. cc https://github.com/rust-lang/rust/issues/63585 follow-up to #120500 MCP at https://github.com/rust-lang/compiler-team/issues/720
2024-03-04Auto merge of #121998 - matthiaskrgr:rollup-l7lzwpb, r=matthiaskrgrbors-155/+140
Rollup of 10 pull requests Successful merges: - #120976 (constify a couple thread_local statics) - #121683 (Fix LVI tests after frame pointers are enabled by default) - #121703 (Add a way to add constructors for `rustc_type_ir` types) - #121732 (Improve assert_matches! documentation) - #121928 (Extract an arguments struct for `Builder::then_else_break`) - #121939 (Small enhancement to description of From trait) - #121968 (Don't run test_get_os_named_thread on win7) - #121969 (`ParseSess` cleanups) - #121977 (Doc: Fix incorrect reference to integer in Atomic{Ptr,Bool}::as_ptr.) - #121994 (Update platform-support.md with supported musl version) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-04Rollup merge of #121969 - nnethercote:ParseSess-cleanups, r=wesleywiserMatthias Krüger-155/+140
`ParseSess` cleanups The main change here is to rename all `ParseSess` values as `psess`. Plus a few other small cleanups. r? `@wesleywiser`
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-154/+139
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
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-04Auto merge of #120468 - alexcrichton:start-wasm32-wasi-rename, r=wesleywiserbors-0/+11
Add a new `wasm32-wasip1` target to rustc This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-04Add `is_intrinsic` helperOli Scherer-1/+1
2024-03-04Tweak `parse_asm_args`.Nicholas Nethercote-1/+1
It doesn't need a `Parser` and a `ParseSess`, because the former contains the latter.
2024-03-04Auto merge of #120585 - Amanieu:ohos-tier2, r=Kobzolbors-0/+3
Promote OpenHarmony targets to tier 2 MCP: rust-lang/compiler-team#719
2024-03-03Rollup merge of #121248 - c410-f3r:testsssssss, r=petrochenkovMatthias Krüger-117/+117
Move some tests r? `@petrochenkov`
2024-03-03Move testsCaio-117/+117
2024-03-03Auto merge of #121936 - RalfJung:miri, r=RalfJungbors-343/+607
Miri subtree update r? `@ghost`
2024-03-03Auto merge of #3345 - RalfJung:win-get-thread-name, r=RalfJungbors-44/+145
Windows: support getting the thread name Also organize the thread name tests a bit.
2024-03-03Windows: support getting the thread nameRalf Jung-20/+94
2024-03-03fix wording of alloc access tracking messageRalf Jung-1/+1
2024-03-03readmeRalf Jung-0/+2
2024-03-03Auto merge of #121931 - lnicola:sync-from-ra, r=lnicolabors-1267/+3264
Subtree update of `rust-analyzer` r? `@ghost`
2024-03-03move thread-panic tests to their own file; test getting the thread nameRalf Jung-24/+51
2024-03-03Merge commit '4ef6a49b44e8aa380da7522442234bfd7a52c55e' into sync-from-raLaurențiu Nicola-1267/+3264
2024-03-03Auto merge of #121877 - estebank:fancy-svg, r=compiler-errorsbors-3/+26
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-3/+26
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-02Tree Borrows: print where the forbidden access happens; make tag tracking ↵Ralf Jung-104/+125
less verbose
2024-03-02Rollup merge of #121841 - tgross35:f16-f128-step2-intrinsics, r=compiler-errorsGuillaume Boisseau-0/+9
`f16` and `f128` step 2: intrinsics Continuation of https://github.com/rust-lang/rust/pull/121728, another portion of https://github.com/rust-lang/rust/pull/114607. This PR adds `f16` and `f128` intrinsics, and hooks them up to both HIR and LLVM. This is all still unexposed to the frontend, which will probably be the next step. Also update itanium mangling per `@rcvalle's` in https://github.com/rust-lang/rust/pull/121728/files#r1506570300, and fix a typo from step 1. Once these types are usable in code, I will add the codegen tests from #114607 (codegen is passing on that branch) This does add more `unimplemented!`s to Clippy, but I still don't think we can do better until library support is added. r? `@compiler-errors` cc `@Nilstrieb` `@rustbot` label +T-compiler +F-f16_and_f128
2024-03-02Rollup merge of #120761 - rcvalle:rust-dfsan, r=nikicGuillaume Boisseau-0/+9
Add initial support for DataFlowSanitizer 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-02Promote OpenHarmony targets to tier 2Amanieu d'Antras-0/+3
MCP: rust-lang/compiler-team#719
2024-03-02add option to track all read/write accesses to tracked allocationsRalf Jung-14/+38
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-0/+11
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-02print thread name in miri error backtracesRalf Jung-170/+219
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+9
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-02Auto merge of #121878 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 12 commits in 8964c8ccff6e420e2a38b8696d178d69fab84d9d..f772ec0224d3755ce52ac5128a80319fb2eb45d0 2024-02-27 19:22:46 +0000 to 2024-03-01 22:57:35 +0000 - feat(toml): Warn on unset Edition (rust-lang/cargo#13505) - fix(msrv): Report all incompatible packages, not just a random one (rust-lang/cargo#13514) - refactor: abstract `std::fs` away from on-disk index cache (rust-lang/cargo#13515) - chore(deps): update compatible (rust-lang/cargo#13507) - chore(deps): update rust crate rusqlite to 0.31.0 (rust-lang/cargo#13510) - [docs]: Clarify vendored sources as read-only and way to modify (rust-lang/cargo#13512) - chore(deps): update rust crate supports-hyperlinks to v3 (rust-lang/cargo#13511) - refactor: Clarify more Config -&gt; Context (rust-lang/cargo#13506) - test: Make `edition` explicit in packages (rust-lang/cargo#13504) - Add all unit's children recursively for `doc.extern-map` option (rust-lang/cargo#13481) - fix(rustc): Always pass --edition to rustc (rust-lang/cargo#13499) - Silently ignore `cargo::rustc-check-cfg` to avoid MSRV annoyance when stabilizing `-Zcheck-cfg` (rust-lang/cargo#13438) r? ghost
2024-03-01Update cargoWeihang Lo-0/+0
2024-03-02Auto merge of #121870 - matthiaskrgr:rollup-mfpa3jx, r=matthiaskrgrbors-17/+3
Rollup of 11 pull requests Successful merges: - #111505 (Made `INVALID_DOC_ATTRIBUTES` lint deny by default) - #120305 (Delete line if suggestion would replace it with an empty line) - #121153 (Suggest removing superfluous semicolon when statements used as expression) - #121497 (`-Znext-solver=coherence`: suggest increasing recursion limit) - #121634 (Clarify behavior of slice prefix/suffix operations in case of equality) - #121706 (match lowering: Remove hacky branch in sort_candidate) - #121730 (Add profiling support to AIX) - #121750 (match lowering: Separate the `bool` case from other integers in `TestKind`) - #121803 (Never say "`Trait` is implemented for `{type error}`") - #121811 (Move sanitizer ui tests to sanitizer directory) - #121824 (Implement missing ABI structures in StableMIR) r? `@ghost` `@rustbot` modify labels: rollup
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 #120305 - clubby789:unused-import-line, r=estebankMatthias Krüger-14/+0
Delete line if suggestion would replace it with an empty line Fixes #120296
2024-03-01Auto merge of #121395 - nikic:update-llvm-21, r=cuviperbors-1/+2
Update to LLVM 18.1.0 rc 4 Fixes https://github.com/rust-lang/rust/issues/120819. Fixes https://github.com/rust-lang/rust/issues/121180. Fixes https://github.com/rust-lang/rust/issues/121239. Fixes https://github.com/rust-lang/rust/issues/121367.
2024-03-01Auto merge of #121859 - matthiaskrgr:rollup-i724wpm, r=matthiaskrgrbors-24/+202
Rollup of 12 pull requests Successful merges: - #120646 (Fix incorrect suggestion for uninitialized binding in pattern) - #121416 (Improve error messages for generics with default parameters) - #121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions) - #121580 (make unused_imports less assertive in test modules) - #121736 (Remove `Mutex::unlock` Function) - #121784 (Make the success arms of `if lhs || rhs` meet up in a separate block) - #121818 (CFI: Remove unused `typeid_for_fnsig`) - #121819 (Handle stashing of delayed bugs) - #121828 (Remove unused fluent messages) - #121831 (Fix typo in comment) - #121850 (Make `ZeroablePrimitive` trait unsafe.) - #121853 (normalizes-to: handle negative impls) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-01Propegate HIR and AST `f16` and `f128` types to clippyTrevor Gross-0/+9