about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-09-16Rollup merge of #146442 - Qelxiros:trait-suggestion-generics, r=BoxyUwUMatthias Krüger-6/+23
Display ?Sized, const, and lifetime parameters in trait item suggestions across a crate boundary context: rust-lang/rust#145929 This fixes the MetaSized issue and adds const generics and early bound lifetimes. Late bound lifetimes are harder because they aren't returned by `generics_of`. I'm going to look into it, but there's no guarantee I'll be successful. Fixes https://github.com/rust-lang/rust/issues/146404. r? `@BoxyUwu`
2025-09-16Detect top-level `...` in argument typeEsteban Küber-7/+14
When writing something like the expression `|_: ...| {}`, we now detect the `...` during parsing explicitly instead of relying on the detection in `parse_ty_common` so that we don't talk about "nested `...` are not supported". ``` error: unexpected `...` --> $DIR/no-closure.rs:6:35 | LL | const F: extern "C" fn(...) = |_: ...| {}; | ^^^ | = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list ```
2025-09-16cmse: fix 'region variables should not be hashed'Folkert de Vries-0/+39
2025-09-16Reword noteEsteban Küber-1/+1
2025-09-16remove redundant testEsteban Küber-20/+0
2025-09-16Add span for struct tail recursion limit errorTawan Muadmuenwai-31/+45
2025-09-16handle const generics, ?Sized, early bound lifetimesJeremy Smart-6/+23
2025-09-16Keep space if expr follows identifier when lint unused parensMu001999-0/+65
2025-09-16Fix other uses of "adaptor"Joe Birr-Pixton-2/+2
2025-09-16fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadicFolkert de Vries-23/+99
2025-09-16Suggest removing Box::newCameron Steffen-3/+27
2025-09-16Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalatharbors-285/+213
Rollup of 9 pull requests Successful merges: - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`) - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions) - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization) - rust-lang/rust#146466 (llvm-wrapper: other cleanup) - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default) - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`) - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again) - rust-lang/rust#146608 (improve internal bootstrap docs) - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-15Don’t suggest foreign `doc(hidden)` types in E0277 diagnosticsJules Bertholet-14/+78
2025-09-16Rollup merge of #145095 - tiif:unstable_const_param, r=BoxyUwUStuart Cook-285/+213
Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_` Now that we have ``#[unstable_feature_bound]``, we can remove ``UnsizedConstParamTy`` that was meant to be an unstable impl of stable type and ``ConstParamTy_`` trait. r? `@BoxyUwU`
2025-09-15Rollup merge of #146559 - Jules-Bertholet:fix-typo, r=nnethercoteMatthias Krüger-7/+7
Fix typo in error message
2025-09-15remove FIXME from `has_significant_drop`, replaced with checking ↵ash-0/+18
non_region_infer
2025-09-15fix: Move CoerceShared into opsAapo Alasuutari-6/+7
2025-09-15Bump rustfix 0.8.1 -> 0.8.7Jynn Nelson-8/+8
This commit can be replicated by running `cargo update -p rustfix --precise 0.8.7 && x test ui --bless`. --- The reasons this affects UI tests is as follows: - The UI test suite runs rustc with `-Z deduplicate-diagnostics=no --error-format=json`, which means that rustc emits multiple errors containing identical suggestions. That caused the weird-looking code that had multiple `X: Copy` suggestions. - Those suggestions are interpreted not by rustc itself, but by the `rustfix` library, maintained by cargo but published as a separate crates.io library and used by compiletest. - Sometime between rustfix 0.8.1 and 0.8.7 (probably in cargo 14747, but it's hard to tell because rustfix's versioning doesn't match cargo's), rustfix got smarter and stopped applying duplicate suggestions. Update rustfix to match cargo's behavior. Ideally, we would always share a version of rustfix between cargo and rustc (perhaps with a path dependency?), to make sure we are testing the behavior we ship. But for now, just manually update it to match. Note that the latest version of rustfix published to crates.io is 0.9.1, not 0.8.7. But 0.9.1 is not the version used in cargo, which is 0.9.3. Rather than trying to match versions exactly, I just updated rustfix to the latest in the 0.8 branch.
2025-09-15Introduce basic Reborrow testsAapo Alasuutari-0/+215
2025-09-15Add reborrow CoerceShared feature gate testAapo Alasuutari-0/+16
2025-09-15Fix feature gate teststiif-23/+24
2025-09-15Only run Cranelift dist test on nightlyJakub Beránek-0/+1
2025-09-15Fix existing testEsteban Küber-17/+4
2025-09-15Silence inference error on `PatKind::Err`Esteban Küber-14/+1
2025-09-15Detect attempt to use var-args in closureEsteban Küber-0/+33
``` error: unexpected `...` --> $DIR/varargs-in-closure-isnt-supported.rs:5:20 | LL | let mut lol = |...| (); | ^^^ not a valid pattern | = note: C-variadic type `...` is not allowed here ```
2025-09-15Fix the testcases to not use UnsizedConstParamTytiif-291/+218
2025-09-15Rollup merge of #143314 - tshepang:fix-filename, r=compiler-errorsMatthias Krüger-0/+1
add reference id to test, and fix filename Noticed the filename is wrong, then took advantage of being there by adding Reference id
2025-09-14Fix typo in error messageJules Bertholet-7/+7
2025-09-14Move more early buffered lints to dyn lint diagnostics (1/N)León Orell Valerian Liehr-2/+2
2025-09-14clean up issue-21950 (dyn trait cast without assoc type at the cast)omskscream-13/+20
2025-09-14clean up issue-18088 (operator from supertrait)omskscream-8/+13
2025-09-14clean up issue-19479 (assoc type from another trait)omskscream-0/+6
2025-09-14clean up issue-2284 (core marker trait name shadowing)omskscream-13/+21
2025-09-13initial implementation of the darwin_objc unstable featureJo Bates-0/+304
2025-09-13Rollup merge of #146521 - folkertdev:document-va-arg-safe, r=workingjubileeJacob Pratt-0/+62
document `core::ffi::VaArgSafe` tracking issue: https://github.com/rust-lang/rust/issues/44930 A modification of https://github.com/rust-lang/rust/pull/146454, keeping just the documentation changes, but not unsealing the trait. Although conceptually we'd want to unseal the trait, there are many edge cases to supporting arbitrary types. We'd need to exhaustively test that all targets/calling conventions support all types that rust might generate (or generate proper error messages for unsupported cases). At present, many of the `va_arg` implementations assume that the argument is a scalar, and has an alignment of at most 8. That is totally sufficient for an MVP (accepting all of the "standard" C types), but clearly does not cover all rust types. This PR also adds some various other tests for edge cases of c-variadic: - the `#[inline]` attribute in its various forms. At present, LLVM is unable to inline c-variadic functions, but the attribute should still be accepted. `#[rustc_force_inline]` already rejects c-variadic functions. - naked functions should accept and work with a C variable argument list. In the future we'd like to allow more ABIs with naked functions (basically, any ABI for which we accept defining foreign c-variadic functions), but for now only `"C"` and `"C-unwind` are supported - guaranteed tail calls: c-variadic functions cannot be tail-called. That was already rejected, but there was not test for it. r? `@workingjubilee`
2025-09-13Rollup merge of #146171 - scrabsha:push-wovnxxwltsun, r=WaffleLapkinJacob Pratt-2/+2
tidy: check that error messages don't start with a capitalized letter
2025-09-13c-variadic: check that c-variadic functions cannot be tail-calledFolkert de Vries-0/+22
as far as I can see this was not tested, though the error message was already implemented
2025-09-13c-variadic: test `...` with naked functionsFolkert de Vries-0/+40
2025-09-13Auto merge of #145186 - camsteffen:assoc-impl-kind, r=petrochenkovbors-18/+2
Make `AssocItem` aware of its impl kind The general goal is to have fewer query dependencies by making `AssocItem` aware of its parent impl kind (inherent vs. trait) without having to query the parent def_kind. See individual commits.
2025-09-13Auto merge of #146499 - jhpratt:rollup-ufflehe, r=jhprattbors-62/+184
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144498 (Add --print target-spec-json-schema) - rust-lang/rust#145471 (Stabilize BTree{Map,Set}::extract_if) - rust-lang/rust#145896 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#3 of Batch rust-lang/rust#2]) - rust-lang/rust#146450 (bootstrap: rustdoc-js tests can now be filtered by js files) - rust-lang/rust#146456 (Fix panic and incorrectly suggested examples in `format_args` macro.) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-13Rollup merge of #146456 - IoaNNUwU:issue-146446, r=estebankJacob Pratt-1/+77
Fix panic and incorrectly suggested examples in `format_args` macro. Follow up on rust-lang/rust#146123 Fixes: rust-lang/rust#146446 r? `@estebank`
2025-09-13Rollup merge of #145896 - Oneirical:uncountable-integer-10, r=jieyouxuJacob Pratt-57/+104
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2] Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
2025-09-13Rollup merge of #145471 - rs-sac:extr, r=the8472Jacob Pratt-1/+0
Stabilize BTree{Map,Set}::extract_if Tracking issue: rust-lang/rust#70530 FCP completed: https://github.com/rust-lang/rust/issues/70530#issuecomment-3191454465 Closes: rust-lang/rust#70530
2025-09-13Rollup merge of #144498 - Noratrieb:rustc-json-schema, r=jieyouxu,davidtwcoJacob Pratt-3/+3
Add --print target-spec-json-schema This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema. I was motivated to do this because I saw someone write their own version of this schema by hand, so demand for this clearly exists. It's not a lot of effort to implement, so I thought it would make sense. MCP: https://github.com/rust-lang/compiler-team/issues/905 I think it would also be useful to put this in the sysroot in `etc` so people can link it directly in their editors. I would have loved to add a test that validates the JSON schema against the spec JSON of every builtin target, but I don't want to do it as the JSON schema validation crates have incredible amounts of dependencies because JSON schema supports a ton of random features. I don't want to add that, even as a dev dependency.
2025-09-13Auto merge of #146394 - Enselic:debuginfo-level-tests-2, r=jieyouxubors-8/+16
ci: Increase `rust.debuginfo-level-tests` to `2` in `x86_64-gnu-debug` job Simply to increase the scope of the testing. Part of https://github.com/rust-lang/rust/issues/61117. cc rust-lang/rust#145967 and rust-lang/rust#146025 which prepared for this. And rust-lang/rust#144499 that set to level to `1` try-job: x86_64-gnu-debug
2025-09-13Rollup merge of #146403 - cyrgani:array-sugg-sorting, r=fee1-deadJana Dönszelmann-8/+8
sort array trait implementation suggestions correctly Fixes rust-lang/rust#135098. Previously tried in rust-lang/rust#137428.
2025-09-13Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obkJana Dönszelmann-80/+200
Convert `no_std` and `no_core` to the new attribute infrastructure r? ```@oli-obk``` Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-18/+2
2025-09-12Add --print target-spec-json-schemaNoratrieb-3/+3
This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.
2025-09-12Add test batch 3Oneirical-57/+104