about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-03-25privacy: Visit types and traits in impls in type privacy lintsVadim Petrochenkov-5/+24
2025-03-25add FCW to warn about wasm ABI transitionRalf Jung-1/+126
2025-03-25Rollup merge of #138838 - compiler-errors:new-solver-crashes-tweaks, r=lcnrTakayuki Maeda-22/+88
Fix/tweak some tests in new solver Bunch of miscellaneous new solver tweaks that I found from the failing tests. Can split these out, but they all seemed small enough to not warrant separate PRs. r? lcnr
2025-03-25Add a test with an empty crate name.Nicholas Nethercote-0/+13
This error was untested.
2025-03-24Test linking and running no_std binariesMads Marquart-0/+41
2025-03-24Rollup merge of #138868 - mejrs:d_not_recommend_typo, r=davidtwcoMatthias Krüger-1/+18
Add do_not_recommend typo help
2025-03-24Emit `unused_attributes` for `#[inline]` on exported functionsNoratrieb-6/+67
I saw someone post a code sample that contained these two attributes, which immediately made me suspicious. My suspicions were confirmed when I did a small test and checked the compiler source code to confirm that in these cases, `#[inline]` is indeed ignored (because you can't exactly `LocalCopy`an unmangled symbol since that would lead to duplicate symbols, and doing a mix of an unmangled `GloballyShared` and mangled `LocalCopy` instantiation is too complicated for our current instatiation mode logic, which I don't want to change right now). So instead, emit the usual unused attribute lint with a message saying that the attribute is ignored in this position. I think this is not 100% true, since I expect LLVM `inlinehint` to still be applied to such a function, but that's not why people use this attribute, they use it for the `LocalCopy` instantiation mode, where it doesn't work.
2025-03-24Test Command::current_dir with verbatim pathChris Denton-0/+36
2025-03-24Mark a fixed testMichael Goulet-3/+8
2025-03-24Don't ICE when encountering placeholders in layout computationMichael Goulet-8/+22
2025-03-24Don't mark privacy test as needing GCEMichael Goulet-11/+10
2025-03-24Allow WellFormed goals to be returned from relating in new solverMichael Goulet-0/+48
2025-03-24Revert "Rollup merge of #136127 - WaffleLapkin:dyn_ptr_unwrap_cast, ↵Michael Goulet-376/+0
r=compiler-errors" This reverts commit 84c2050bf63f734246572345aedca9edb2abe96e, reversing changes made to a96fa317d78c78a9de996afd317603c6970efc0d.
2025-03-24Fix autofix for `self` and `self as …` in `unused_imports` lintSamuel Tardieu-0/+103
This fixes two problems with the autofixes for the `unused_imports` lint: - `use std::collections::{HashMap, self as coll};` would suggest, when `HashMap` is unused, the incorrect `use std::collections::self as coll;` which does not compile. - `use std::borrow::{self, Cow};` would suggest, when `self` is unused, `use std::borrow::{Cow};`, which contains unnecessary brackets.
2025-03-24Fix ui pattern_types test for big-endian platformsEduard Stefes-13/+15
The newly added pattern types validity tests fail on s390x and presumably other big-endian systems, due to print of raw values with padding bytes. To fix the tests remove the raw output values in the error note by `normalize-stderr`.
2025-03-24Add do_not_recommend typo helpmejrs-1/+18
2025-03-23Rollup merge of #138854 - TaKO8Ki:invalid-extern-fn-body, r=compiler-errorsMichael Goulet-0/+31
Fix ICE #138415 for invalid extern function body Fixes #138415
2025-03-23Rollup merge of #138641 - jieyouxu:print-supported-crate-types, r=UrgauMichael Goulet-5/+51
Add unstable `--print=supported-crate-types` option MCP: https://github.com/rust-lang/compiler-team/issues/836 Tracking issue: https://github.com/rust-lang/rust/issues/138640 ### Test coverage Two tests: 1. `tests/ui/print-request/stability.rs` to check that `--print=supported-crate-types` is `-Zunstable-options`-gated 2. `tests/ui/print-request/supported-crate-types.rs` is added as a basic smoke test. Observe that the compiler stdout corresponds to the below *Example output* section (e.g. `proc-macro` is unsupported on `wasm32-unknown-unknown` currently). ### Example output <details> <summary>For `x86_64-unknown-linux-gnu`</summary> Notice the presence of `{c,}dylib` and `proc-macro`: ``` bin cdylib dylib lib proc-macro rlib staticlib ``` </details> <details> <summary>For `wasm32-unknown-unknown`</summary> Notice the absence of `dylib` and `proc-macro`: ``` bin cdylib lib rlib staticlib ``` </details> <details> <summary>For `x86_64-unknown-linux-musl`</summary> Notice the absence of `{c,}dylib` but presence of `proc-macro`: ``` bin lib proc-macro rlib staticlib ``` </details> ### Documentation I added an entry in the unstable book's print request section to document this `supported-crate-types` print request. ### Unresolved questions - [ ] (Name bikeshedding) is `supported-crate-types` a good name for the print request? I'm inclined to say it's good enough for an unstable print request, but may be worth revisiting at stabilization time. ### Stability This print request being added is *unstable* in this PR. A separate stabilization PR following the usual compiler flag stabilization procedure should be filed for stabilization after some baking time. ### Review remarks Best reviewed commit-by-commit. r? compiler
2025-03-23Rollup merge of #138509 - reddevilmidzy:add-test, r=compiler-errorsMichael Goulet-0/+44
Add test to ensure no index out of bounds panic (#135474) Adds test for #135474
2025-03-23fix: running the test only on x86_64.Hadrien Eyraud-2/+3
The test was failing on aarch64-apple-darwin.
2025-03-23fix: Check empty SIMD vector in inline asmHadrien Eyraud-0/+29
2025-03-23Stabilize precise_capturing_in_traitsMichael Goulet-56/+20
2025-03-23Adjust `rustc-print-info-issue-138612.rs`Jieyou Xu-3/+8
- Document test intent to check for `-Whelp` suggestion if `--print=lints` was specified. - Move this test under `tests/ui/print-request/` and rename it to `print-lints-help.rs` to better reflect what it is checking.
2025-03-23Rebless tests with changed help due to new print request optionJieyou Xu-2/+2
2025-03-23Implement `supported-crate-types` print requestJieyou Xu-0/+41
As an unstable print request.
2025-03-23fix ICE #138415Takayuki Maeda-0/+31
2025-03-22Auto merge of #138841 - matthiaskrgr:rollup-bfkls57, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #138018 (rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.) - #138294 (Mark some std tests as requiring `panic = "unwind"`) - #138468 (rustdoc js: add nonnull helper and typecheck src-script.js) - #138675 (Add release notes for 1.85.1) - #138765 (Fix Thread::set_name on cygwin) - #138786 (Move some driver code around) - #138793 (target spec check: better error when llvm-floatabi is missing) - #138822 (De-Stabilize `file_lock`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-22Rollup merge of #138786 - bjorn3:driver_code_move, r=compiler-errorsMatthias Krüger-1/+1
Move some driver code around `--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
2025-03-22Rollup merge of #138794 - petrochenkov:cfgtracefix, r=jieyouxuMatthias Krüger-7/+14
expand: Do not report `cfg_attr` traces on macros as unused attributes Fixes https://github.com/rust-lang/rust/issues/138779
2025-03-22Rollup merge of #138782 - karolzwolak:where-test-91520, r=compiler-errorsMatthias Krüger-0/+38
test(ui): add tuple-struct-where-clause-suggestion ui test for #91520 Fixes #91520 I tried to also make it a .fixed test, but I failed to accomplish that. That's because of the 'consider annotating `Inner<T>` with `#[derive(Clone)]`' suggestion does not compile (conflicting Clone implementations), and I can't isolate them with `rustfix-only-machine-applicable` as both suggestions are not marked as `MachineApplicable`. Instead I just test that the where clause suggestion is applied to the correct line.
2025-03-22Rollup merge of #138639 - spencer3035:clean-ui-tests-2-of-n, r=jieyouxuMatthias Krüger-74/+64
Clean UI tests 2 of n Modified 4 tests in tests/ui. Cleaned 3 and deleted one. I have a final commit changing the values in `src/tools/tidy/src/ui_tests.rs`. I wasn't sure if it was best practice to change this value as you go along or once at the end. I can rebase to something that incrementally changes the value in the "cleaned" commits if that is preferred. Related Issues: #73494 #133895 r? jieyouxu
2025-03-22Make UniqueArc invariant for soundnessFrank King-1/+43
2025-03-22Auto merge of #138719 - lcnr:concrete_opaque_types-closures, r=oli-obkbors-86/+59
merge opaque types defined in nested bodies A small step towards https://github.com/rust-lang/types-team/issues/129 r? `@oli-obk`
2025-03-21cleaned and organized 3 tests in `./tests/ui/issues`Spencer-74/+64
2025-03-22Note potential but private items in show_candidatesxizheyin-2/+123
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-22Add test to ensure no index out of bounds panic (#135474)Redddy-0/+44
2025-03-21expand: Do not report `cfg_attr` traces on macros as unused attributesVadim Petrochenkov-7/+14
2025-03-21Rollup merge of #138721 - jchecahi:tests-explicit-cpus, r=tgross35Matthias Krüger-23/+24
Use explicit cpu in some asm and codegen tests. Some tests expect to be compiled for a specific CPU or require certain target features to be present (or absent). These tests work fine with default CPUs but fail in downstream builds for RHEL and Fedora, where we use non-default CPUs such as z13 on s390x, pwr9 on ppc64le, or x86-64-v2/x86-64-v3 on x86_64. This is similar to #124597.
2025-03-21Rollup merge of #138570 - folkertdev:naked-function-target-feature-gate, ↵Matthias Krüger-7/+49
r=Amanieu add `naked_functions_target_feature` unstable feature tracking issue: https://github.com/rust-lang/rust/issues/138568 tagging https://github.com/rust-lang/rust/pull/134213 https://github.com/rust-lang/rust/issues/90957 This PR puts `#[target_feature(/* ... */)]` on `#[naked]` functions behind its own feature gate, so that naked functions can be stabilized. It turns out that supporting `target_feature` on naked functions is tricky on some targets, so we're splitting it out to not block stabilization of naked functions themselves. See the tracking issue for more information and workarounds. Note that at the time of writing, the `target_features` attribute is ignored when generating code for naked functions. r? ``@Amanieu``
2025-03-21Fix lint name in unused linker_messages warningbjorn3-1/+1
2025-03-21test(ui): add tuple-struct-where-clause-suggestion ui test for #91520Karol Zwolak-0/+38
2025-03-21remove `feature(inline_const_pat)`lcnr-833/+95
2025-03-21Rollup merge of #138751 - Jeff-A-Martin:used-with-archive-test-fuchsia, ↵Matthias Krüger-0/+1
r=jieyouxu Fix the "used_with_archive" test on Fuchsia This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
2025-03-21Rollup merge of #138724 - fmease:list-stems-bear-no-name, r=nnethercoteMatthias Krüger-0/+11
Check attrs: Don't try to retrieve the name of list stems Fixes #138723. r? nnethercote or compiler
2025-03-20Auto merge of #138747 - matthiaskrgr:rollup-68x44rw, r=matthiaskrgrbors-6/+82
Rollup of 8 pull requests Successful merges: - #138435 (Add support for postfix yield expressions) - #138685 (Use `Option<Ident>` for lowered param names.) - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc) - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`) - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`) - #138731 (coverage: Add LLVM plumbing for expansion regions) - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`) - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-20Auto merge of #138515 - petrochenkov:cfgtrace, r=nnethercotebors-0/+79
expand: Leave traces when expanding `cfg_attr` attributes Currently `cfg_trace` just disappears during expansion, but after this PR `#[cfg_attr(some tokens)]` will leave a `#[cfg_attr_trace(some tokens)]` attribute instead of itself in AST after expansion (the new attribute is built-in and inert, its inner tokens are the same as in the original attribute). This trace attribute can then be used by lints or other diagnostics, #133823 has some examples. Tokens in these trace attributes are set to an empty token stream, so the traces are non-existent for proc macros and cannot affect any user-observable behavior. This is also a weakness, because if a proc macro processes some code with the trace attributes, they will be lost, so the traces are best effort rather than precise. The next step is to do the same thing with `cfg` attributes (`#[cfg(TRUE)]` currently remains in both AST and tokens after expanding, it should be replaced with a trace instead). The idea belongs to `@estebank.`
2025-03-20Fix the "used_with_archive" test on FuchsiaJeff Martin-0/+1
This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
2025-03-20Make dedicated recovery for missing braces on closure with returnMichael Goulet-6/+12
2025-03-20Fix diagnostic struct typo, make sure is_array_like_block checks that it's a ↵Michael Goulet-2/+38
block
2025-03-20Rollup merge of #138732 - compiler-errors:did, r=jieyouxuMatthias Krüger-6/+6
Use `def_path_str` for def id arg in `UnsupportedOpInfo` We could alternatively just omit the def path from the label, but I think it's fine to keep around Fixes #138730