about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-03-04Make rustdoc tests use always applicable negative auto implsMichael Goulet-60/+100
2025-03-04Ensure that negative auto impls are always applicableMichael Goulet-47/+137
2025-03-04Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3bors-7/+266
Support raw-dylib link kind on ELF raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time. I was inspired by Björn's comments in https://internals.rust-lang.org/t/bundle-zig-cc-in-rustup-by-default/22096/27 Tracking issue: #135694 r? bjorn3 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-03-04mgca: Lower all const paths as `ConstArgKind::Path`Noah Lev-12/+180
When `#![feature(min_generic_const_args)]` is enabled, we now lower all const paths in generic arg position to `hir::ConstArgKind::Path`. We then lower assoc const paths to `ty::ConstKind::Unevaluated` since we can no longer use the anon const expression lowering machinery. In the process of implementing this, I factored out `hir_ty_lowering` code that is now shared between lowering assoc types and assoc consts. This PR also introduces a `#[type_const]` attribute for trait assoc consts that are allowed as const args. However, we still need to implement code to check that assoc const definitions satisfy `#[type_const]` if present (basically is it a const path or a monomorphic anon const).
2025-03-04Fix test hangs on AIXHenry Jiang-3/+10
2025-03-04Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgrbors-121/+659
Rollup of 12 pull requests Successful merges: - #135767 (Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies) - #137852 (Remove layouting dead code for non-array SIMD types.) - #137863 (Fix pretty printing of unsafe binders) - #137882 (do not build additional stage on compiler paths) - #137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset") - #137902 (Make `ast::TokenKind` more like `lexer::TokenKind`) - #137921 (Subtree update of `rust-analyzer`) - #137922 (A few cleanups after the removal of `cfg(not(parallel))`) - #137939 (fix order on shl impl) - #137946 (Fix docker run-local docs) - #137955 (Always allow rustdoc-json tests to contain long lines) - #137958 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-04Allow struct field default values to reference struct's genericsMichael Goulet-18/+107
2025-03-04Also note struct access, and fix macro expansion from foreign cratesMichael Goulet-0/+33
2025-03-03Fix associated type errors tooMichael Goulet-0/+45
2025-03-03Point out macro expansion ident in resolver errors tooMichael Goulet-0/+18
2025-03-03Point of macro expansion from call expr if it involves macro varMichael Goulet-0/+39
2025-03-03Inline FnOnce once againMichael Goulet-103/+381
2025-03-03Don't typeck during WF, instead check outside of WF in check_crateMichael Goulet-52/+81
2025-03-03Check signature WF when lowering MIR bodyMichael Goulet-2/+41
2025-03-03Tweak error code for sized checks of const/staticMichael Goulet-0/+11
2025-03-03Auto merge of #137927 - matthiaskrgr:rollup-yj463ns, r=matthiaskrgrbors-38/+2945
Rollup of 9 pull requests Successful merges: - #132388 (Implement `#[cfg]` in `where` clauses) - #134900 (Fix parsing of ranges after unary operators) - #136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern) - #137054 (Make phantom variance markers transparent) - #137525 (Simplify parallelization in test-float-parse) - #137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch) - #137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`) - #137849 (Revert "Remove Win SDK 10.0.26100.0 from CI") - #137862 (ensure we always print all --print options in help) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-03Add timestamp to unstable feature usage metricsJane Losare-Lusby-3/+8
2025-03-03Rollup merge of #137955 - Noratrieb:rustdoc-json-long-lines, ↵Matthias Krüger-72/+0
r=aDotInTheVoid,jieyouxu Always allow rustdoc-json tests to contain long lines The rustdoc-json test syntax often requires very long lines, so the checks for long lines aren't really useful. `@aDotInTheVoid` told me she'd like this and r? jieyouxu you're gonna tell me that the implementation is terrible. at least the performance seems reasonable: 2.5s after and 2.5s before.
2025-03-03Rollup merge of #137894 - compiler-errors:no-scalar-pair-opt, r=oli-obkMatthias Krüger-43/+8
Revert "store ScalarPair via memset when one side is undef and the other side can be memset" cc #137892 reverts #135335 r? oli-obk
2025-03-03Rollup merge of #137863 - compiler-errors:unsafe-binder-render, r=oli-obkMatthias Krüger-0/+43
Fix pretty printing of unsafe binders We used to render `unsafe<> i32` as `i32`, and `unsafe<'a> &'a i32` as `for<'a> &'a i32`. r? oli-obk Review with whitespace b/c adding a new argument changes some the wrapping of some function calls.
2025-03-03Auto merge of #137914 - matthiaskrgr:rollup-phaxe6f, r=matthiaskrgrbors-109/+124
Rollup of 6 pull requests Successful merges: - #137103 ({json|html}docck: catch and error on deprecated syntax) - #137632 (rustdoc: when merging target features, keep the highest stability) - #137684 (Add rustdoc support for `--emit=dep-info[=path]`) - #137794 (make qnx pass a test) - #137801 (tests: Unignore target modifier tests on all platforms) - #137826 (test(codegen): add looping_over_ne_bytes test for #133528) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-03Remove i586-pc-windows-msvcNoratrieb-8/+1
See MCP 840. I left a specialized error message that should help users that hit this in the wild (for example, because they use it in their CI).
2025-03-03Always allow rustdoc-json tests to contain long linesNoratrieb-72/+0
The rustdoc-json test syntax often requires very long lines, so the checks for long lines aren't really useful.
2025-03-03Provide more context on resolve error caused from incorrect RTNEsteban Küber-11/+70
When encountering a resolve E0575 error for an associated method (when a type was expected), see if it could have been an intended return type notation bound. ``` error[E0575]: expected associated type, found associated function `Trait::method` --> $DIR/bad-inputs-and-output.rs:31:36 | LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type | help: you might have meant to use the return type notation syntax | LL - fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {} LL + fn foo_qualified<T: Trait>() where T::method(..): Send {} | ```
2025-03-04[rustdoc] hide item that is not marked as doc(inline) and whose src is ↵xizheyin-24/+40
doc(hidden) Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-04tests: manually rebless `tests/ui-fulldeps/codegen-backend/hotplug.rs`许杰友 Jieyou Xu (Joe)-3/+3
2025-03-04tests: rebless some tests as a side-effect of `TEST_BUILD_DIR` changes许杰友 Jieyou Xu (Joe)-16/+16
2025-03-04tests: remove explicit long type filename hash normalization from some ui tests许杰友 Jieyou Xu (Joe)-156/+109
2025-03-03Apply dllimport in ThinLTOJohn Kåre Alsaker-28/+0
2025-03-03Rollup merge of #137862 - mtoner23:print-help, r=nnethercoteMatthias Krüger-3/+3
ensure we always print all --print options in help Closes #137853 Refactors the PRINT_KINDS map into a public const so we always print every option for print. the list is quite long now, and idk if long term we want to keep printing all these options from --help.
2025-03-03Rollup merge of #136938 - mustartt:fix-stack-protector-filecheck, ↵Matthias Krüger-16/+16
r=Mark-Simulacrum Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern With function sections, the assembly label does not necessarily end in `:`. Remove trailing `:` to be more consistent with the rest of the existing Filecheck patterns. ``` // CHECK-LABEL: local_string_addr_taken #[no_mangle] pub fn local_string_addr_taken(f: fn(&String)) { let x = String::new(); f(&x); ```
2025-03-03Rollup merge of #134900 - dtolnay:unoprange, r=compiler-errors,davidtwcoMatthias Krüger-1/+27
Fix parsing of ranges after unary operators Fixes https://github.com/rust-lang/rust/issues/134899. This PR aligns the parsing for unary `!` and `-` and `*` with how unary `&` is already parsed [here](https://github.com/rust-lang/rust/blob/5c0a6e68cfdad859615c2888de76505f13e6f01b/compiler/rustc_parse/src/parser/expr.rs#L848-L854).
2025-03-03Rollup merge of #132388 - frank-king:feature/where-cfg, r=petrochenkovMatthias Krüger-18/+2899
Implement `#[cfg]` in `where` clauses This PR implements #115590, which supports `#[cfg]` attributes in `where` clauses. The biggest change is, that it adds `AttrsVec` and `NodeId` to the `ast::WherePredicate` and `HirId` to the `hir::WherePredicate`.
2025-03-03Bless UI testsTamme Dittrich-54/+54
2025-03-03Change variadic-ffi-2 to use a platform independant ABITamme Dittrich-17/+4
Otherwise this test will include a future incompatibility warning on some targets but not others.
2025-03-03Bless UI testsTamme Dittrich-1/+616
2025-03-03Do not recover missing lifetime with random in-scope lifetimeMichael Goulet-174/+36
2025-03-03Rollup merge of #137826 - karolzwolak:looping_over_ne_bytes_133528, r=DianQKMatthias Krüger-0/+17
test(codegen): add looping_over_ne_bytes test for #133528 Adds test for #133528. I renamed the function to `looping_over_ne_bytes` to better reflect that it is doing. I also set the min llvm version to 20 as this was presumably a llvm bug that was fixed in version 20. I didn't tie the test to any specific architecture, as we are testing llvm output.
2025-03-03Rollup merge of #137801 - petrochenkov:tarmod, r=compiler-errorsMatthias Krüger-104/+43
tests: Unignore target modifier tests on all platforms These tests can be `check-pass` and do not need dynamic libraries. Also remove other unnecessary stuff from them. Follow up to https://github.com/rust-lang/rust/pull/133138.
2025-03-03Rollup merge of #137794 - tshepang:make-qnx-pass, r=pietroalbiniMatthias Krüger-4/+5
make qnx pass a test [tests/ui/attributes/used_with_archive.rs](https://github.com/rust-lang/rust/blob/b2024300840c3ef94a97273531bdb37d56d50fb5/tests/ui/attributes/used_with_archive.rs) fails when executed for QNX targets, because its stdout does not match [this content](https://github.com/rust-lang/rust/blob/b2024300840c3ef94a97273531bdb37d56d50fb5/tests/ui/attributes/used_with_archive.run.stdout)
2025-03-03Rollup merge of #137684 - GuillaumeGomez:rustdoc-dep-info, r=notriddleMatthias Krüger-1/+31
Add rustdoc support for `--emit=dep-info[=path]` Fixes #91982. This PR adds the `--emit=dep-info` command line flag support. It will be helpful for `cargo` development. cc ````@epage```` r? ````@notriddle````
2025-03-03Rollup merge of #137632 - RalfJung:rustdoc-target-features, r=workingjubileeMatthias Krüger-0/+28
rustdoc: when merging target features, keep the highest stability This addresses https://github.com/rust-lang/rust/issues/137366. (Not closing since we might consider a backport.) rustdoc wants to pretend that it runs for all targets at once and has all target features, so `tcx.rust_target_features()` will actually be all the target features. For target features that exist on multiple targets, the stability info for one of the targets will be picked (first or last in the list, I guess). All the code consuming that query has to be aware that the data is basically nonsense when running in rustdoc, but the logic checking for unstable or forbidden `#[target_feature]` attributes was not aware of that. This PR makes the `tcx.rust_target_features()` info in rustdoc slightly less nonsensical (and decidedly less random) by having the "most stable" target feature take precedent. That deals with #137366 (a conflict between a stable and a "forbidden" target feature of the same name for different targets), and also deals with the situation (that we did not seem to have yet) of a conflict between a stable and an unstable target feature of the same name. Note that if there are two unstable target features of the same name, rustdoc might still require the "wrong" nightly feature to be enabled -- but this can only possibly affect unstable code so I guess we can wait until that actually happens, and then someone will have to rewrite this entire thing to be less hacky.
2025-03-03Improve error message for AsyncFn trait failure for RPITMichael Goulet-0/+31
2025-03-03Fix pretty printing of unsafe bindersMichael Goulet-0/+43
2025-03-02Rollup merge of #137860 - taiki-e:powerpcspe-msync, r=workingjubileeMatthias Krüger-0/+1
rustc_target: Add msync target feature and enable it on powerpcspe targets Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.) LLVM recognizes this as the [`msync` feature](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L140) and enables for some cpus such as [e500](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L644). powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., #96394, #117361). https://github.com/rust-lang/rust/blob/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs#L28 Fixes #117361 cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers)) cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in https://github.com/rust-lang/rust/pull/48484) cc `@th0ma7` (who opened #117361) r? workingjubilee `@rustbot` label +O-PowerPC +A-target-feature
2025-03-02Rollup merge of #137851 - folkertdev:simd-intrinsic-mask-signed, ↵Matthias Krüger-4/+99
r=workingjubilee improve `simd_select` error message when used with invalid mask type followup to https://github.com/rust-lang/rust/pull/137828 This PR improves the error message for an invalid `simd_select` mask type, and adds testing for `simd_scatter` and `simd_gather` being used with invalid mask types. the `simd_masked_load` and `simd_masked_store` intrinsics already generated a better error message: https://github.com/rust-lang/rust/blob/0c72c0d11adeba449886089c6bd5d48363f7a2cd/tests/ui/simd/masked-load-store-build-fail.rs#L24-L37 r? `@workingjubilee`
2025-03-02Add a testMichael Goulet-0/+14
2025-03-02Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin"Michael Goulet-52/+3
This reverts commit a7a6c64a657f68113301c2ffe0745b49a16442d1, reversing changes made to ebbe63891f1fae21734cb97f2f863b08b1d44bf8.
2025-03-02run-make: update test suite README许杰友 Jieyou Xu (Joe)-29/+7
2025-03-02run-make: remove `tools.mk`许杰友 Jieyou Xu (Joe)-209/+0
It has served us well, but it's time to retire the `Makefile` support file since this is no longer needed.