about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-07-10Rollup merge of #143640 - oli-obk:const-fn-traits, r=compiler-errorsMatthias Krüger-562/+69
Constify `Fn*` traits r? `@compiler-errors` `@fee1-dead` this should unlock a few things. A few `const_closures` tests have broken even more than before, but that feature is marked as incomplete anyway cc rust-lang/rust#67792
2025-07-10Rollup merge of #143599 - folkertdev:x86-asm-syntax-global-naked-asm, r=AmanieuMatthias Krüger-0/+75
emit `.att_syntax` when global/naked asm use that option fixes https://github.com/rust-lang/rust/issues/143542 LLVM would error when using `-Cllvm-args=-x86-asm-syntax=intel` in combination with global/naked assembly with `att_syntax`. It turns out that for LLVM you do in this case need to emit `.att_syntax`. r? `@Amanieu`
2025-07-10Rollup merge of #143590 - GuillaumeGomez:reexport-shadowing, r=lolbinaryMatthias Krüger-0/+41
Fix weird rustdoc output when single and glob reexport conflict on a name Fixes rust-lang/rust#143107. The problem was that the second reexport would overwrite the first, leading to having unexpected results. To fix it, I now group items by their original `DefId` and their name and keep tracks of all imports for this item (should very rarely be more than one though, and even less often more than 2). cc `@lolbinarycat`
2025-07-10Rollup merge of #143446 - usamoi:export-executable-symbols, r=bjorn3,oli-obkMatthias Krüger-0/+30
use `--dynamic-list` for exporting executable symbols closes rust-lang/rust#101610 cc rust-lang/rust#84161 https://sourceware.org/binutils/docs-2.39/ld/VERSION.html: > --dynamic-list=dynamic-list-file Specify the name of a dynamic list file to the linker. This is typically used when creating shared libraries to specify a list of global symbols whose references shouldn’t be bound to the definition within the shared library, or creating dynamically linked executables to specify a list of symbols which should be added to the symbol table in the executable. This option is only meaningful on ELF platforms which support shared libraries. `ld.lld --help`: > --dynamic-list=<file>: Similar to --export-dynamic-symbol-list. When creating a shared object, this additionally implies -Bsymbolic but does not set DF_SYMBOLIC > --export-dynamic-symbol-list=file: Read a list of dynamic symbol patterns. Apply --export-dynamic-symbol on each pattern > --export-dynamic-symbol=glob: (executable) Put matched symbols in the dynamic symbol table. (shared object) References to matched non-local STV_DEFAULT symbols shouldn't be bound to definitions within the shared object. Does not imply -Bsymbolic. > --export-dynamic: Put symbols in the dynamic symbol table Use `--dynamic-list` because it's older than `--export-dynamic-symbol-list` (binutils 2.35) try-job: dist-i586-gnu-i586-i686-musl
2025-07-10Properly track the depth when expanding free alias typesLeón Orell Valerian Liehr-0/+20
2025-07-10Update testEsteban Küber-14/+70
2025-07-10Make `Diag::multipart_suggestions` always verboseEsteban Küber-109/+186
2025-07-10Rework borrowing suggestions to use `Expr` instead of just `Span`Esteban Küber-110/+92
In the suggestion machinery for borrowing expressions and types, always use the available obligation `Span` to find the appropriate `Expr` to perform appropriateness checks no the `ExprKind` instead of on the textual snippet corresponding to the `Span`. Unify the logic for the case where `&` *and* `&mut` are appropriate with the logic for only one of those cases. Handle the case when `S::foo()` should have been `<&S>::foo()` (instead of suggesting the prior `&S::foo()`.
2025-07-10Add `BuilderMethods::unreachable_nonterminator`Scott McMurray-21/+20
So places that need `unreachable` but in the middle of a basic block can call that instead of figuring out the best way to do it.
2025-07-10Check assoc consts and tys later like assoc fnsMu001999-20/+123
2025-07-10fix: Include frontmatter in -Zunpretty outputEd Page-0/+2
In the implementation (#140035), this was left as an open question for the tracking issue (#136889). My assumption is that this should be carried over. Thankfully, either way, `-Zunpretty` is unstable and we can always change it even if we stabilize frontmatter.
2025-07-10chore: Improve how the other suggestions message gets renderedScott Schafer-18/+18
2025-07-10test: Make one multi suggestion test unicodeScott Schafer-0/+282
2025-07-10cleaned up some testsKivooeo-112/+177
2025-07-10cleaned up some testsKivooeo-85/+131
2025-07-10Rollup merge of #143683 - jieyouxu:rms-cleanup, r=KobzolMatthias Krüger-53/+57
Assorted `run-make-support` maintenance This PR should contain no functional changes. - Commit 1: Removes the support library's CHANGELOG. In the very beginning, I thought maybe we would try to version this library. But this is a purely internal test support library, and it's just extra busywork trying to maintain changelog/versions. It's also hopelessly outdated. - Commit 2: Resets version number to `0.0.0`. Ditto on busywork. - Commit 3: Bump `run-make-support` to Edition 2024. The support library was already "compliant" with Edition 2024. - Commit 4: Slightly organizes the support library dependencies. - Commit 5: Previously, I tried hopelessly to maintain some manual formatting, but that was annoying because it required skipping rustfmt (so export ordering etc. could not be extra formatted). Give up, and do some rearrangements / module prefix tricks to get the `lib.rs` looking at least *reasonable*. IMO this is not a strict improvement, but I rather regain the ability to auto-format it with rustfmt. - Commit {6,7}: Noticed in rust-lang/rust#143669 that we apparently had *both* {`is_msvc`, `is_windows_msvc`}. This PR removes `is_msvc` in favor of `is_windows_msvc` to make it unambiguous (and only retain one way of gating) as there are some UEFI targets which are MSVC but not Windows. Best reviewed commit-by-commit. r? `@Kobzol`
2025-07-10Rollup merge of #143666 - nilehmann:nested_bodies_in_consumers, r=lcnrMatthias Krüger-8/+18
Re-expose nested bodies in rustc_borrowck::consumers After https://github.com/rust-lang/rust/pull/138499, it's not possible anymore to get borrowck information for nested bodies via `get_body_with_borrowck_facts`. This PR re-exposes nested bodies by returning a map containing the typeck root and all its nested bodies. To collect the bodies, a map is added to `BorrowCheckRootCtxt`, and a body is inserted every time `do_mir_borrowck` is called. r? ``@lcnr``
2025-07-10Rollup merge of #136906 - chenyukang:yukang-fix-136741-closure-body, r=oli-obkMatthias Krüger-16/+136
Add checking for unnecessary delims in closure body Fixes #136741
2025-07-10added error for invalid char castKivooeo-11/+169
2025-07-10Auto merge of #143721 - tgross35:rollup-sjdfp6r, r=tgross35bors-394/+1642
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - rust-lang/rust#142950 (mbe: Rework diagnostics for metavariable expressions) - rust-lang/rust#143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - rust-lang/rust#143265 (Mention as_chunks in the docs for chunks) - rust-lang/rust#143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - rust-lang/rust#143298 (`tests/ui`: A New Order [23/N]) - rust-lang/rust#143396 (Move NaN tests to floats/mod.rs) - rust-lang/rust#143398 (tidy: add support for `--extra-checks=auto:` feature) - rust-lang/rust#143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-10Add regression test for #143107Guillaume Gomez-0/+41
2025-07-10Propagate from borrowed locals in CopyPropTomasz Miąsko-122/+91
2025-07-10Rollup merge of #143298 - Kivooeo:tf23, r=tgross35Trevor Gross-121/+161
`tests/ui`: A New Order [23/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ``@tgross35``
2025-07-10Rollup merge of #143270 - TimNN:fix-enum-match, r=nikicTrevor Gross-1/+1
tests/codegen/enum/enum-match.rs: accept negative range attribute The test current fails when `rustc` is built with HEAD LLVM: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/38097/steps/canvas?sid=0197c492-5661-4c42-8ae7-3d789e85c6ca I suspect the change was caused by https://github.com/llvm/llvm-project/commit/545cdca4883552b147a0f1adfac713f76fc22305 ``@rustbot`` label llvm-main
2025-07-10Rollup merge of #143011 - LorrensP-2158466:warn-ambiguity-into-error, ↵Trevor Gross-115/+508
r=petrochenkov Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps This pr aims to finish the second part of rust-lang/rust#114095. It converts the `ambiguous_glob_imports` lint from a warning to an error. Currently, only the lint definition and the related tests are changed, a crater run should provide us with information on whether we should go for this.
2025-07-10Rollup merge of #142950 - tgross35:metavariable-expr-rework, r=petrochenkovTrevor Gross-110/+115
mbe: Rework diagnostics for metavariable expressions Make the diagnostics for metavariable expressions more user-friendly. This mostly addresses syntactic errors; I will be following up with improvements to `concat(..)`.
2025-07-10Rollup merge of #141996 - Daniel-Aaron-Bloom:dollar_crate, r=petrochenkovTrevor Gross-47/+857
Fix `proc_macro::Ident`'s handling of `$crate` This PR is addresses a few minor bugs, all relating to `proc_macro::Ident`'s support for `$crate`. `Ident` currently supports `$crate` (as can be seen in the `mixed-site-span` test), but: * `proc_macro::Symbol::can_be_raw` is out of sync with `rustc_span::Symbol::can_be_raw` * former doesn't cover `$crate` while the latter does cover `kw::DollarCrate` * `Ident::new` rejects `$crate` * This conflicts with the [reference definition](https://doc.rust-lang.org/nightly/reference/macros-by-example.html#r-macro.decl.meta.specifier) of `ident` which includes `$crate`. * This also conflicts with the documentation on [`Display for Ident`](https://doc.rust-lang.org/proc_macro/struct.Ident.html#impl-Display-for-Ident) which says the output "should be losslessly convertible back into the same identifier". This PR fixes the above issues and extends the `mixed-site-span` test to exercise these fixed code paths, as well as validating the different possible spans resolve `$crate` as expected (for both the new and old `$crate` construction code paths).
2025-07-10Auto merge of #143696 - oli-obk:constable-type-id2, r=RalfJungbors-51/+131
Add opaque TypeId handles for CTFE Reopen of https://github.com/rust-lang/rust/pull/142789#issuecomment-3053155043 after some bors insta-merge chaos r? `@RalfJung`
2025-07-10Use `is_windows_msvc` instead of `is_msvc` in run-make testsJieyou Xu-53/+57
2025-07-09Make UB transmutes really UB in LLVMScott McMurray-9/+13
Ralf suggested in <https://github.com/rust-lang/rust/pull/143410#discussion_r2184928123> that UB transmutes shouldn't be trapping, which happened for the one path that PR was changing, but there's another path as well, so this PR changes that other path to match.
2025-07-10Remove uncessary parens in closure body with unused lintyukang-16/+136
2025-07-09mbe: Refactor the diagnostic for unrecognized metavariable expressionsTrevor Gross-3/+5
Change to a structural diagnostic, update the valid list, and move the valid list to a note.
2025-07-09mbe: Refactor diagnostics for invalid metavar expression syntaxTrevor Gross-107/+110
Give a more user-friendly diagnostic about the following: * Trailing tokens within braces, e.g. `${foo() extra}` * Missing parentheses, e.g. `${foo}` * Incorrect number of arguments, with a hint about correct usage.
2025-07-10Add rustdoc JSON tests for `#[doc(hidden)]` handling of items.Predrag Gruevski-0/+36
2025-07-09fix aux-build failuresLorrensP-2158466-30/+50
2025-07-09test: Verify frontmatter unpretty behaviorEd Page-0/+17
2025-07-09miri: fix out-of-bounds error for ptrs with negative offsetsRalf Jung-10/+10
2025-07-09Make AsyncDrop check that it's being implemented on a local ADTMichael Goulet-1/+46
2025-07-09Auto merge of #143502 - scottmcm:aggregate-simd, r=oli-obkbors-9/+135
Let `rvalue_creates_operand` return true for *all* `Rvalue::Aggregate`s ~~Draft for now because it's built on Ralf's rust-lang/rust#143291~~ Inspired by https://github.com/rust-lang/rust/pull/138759#discussion_r2156375342 where I noticed that we were nearly at this point, plus the comments I was writing in rust-lang/rust#143410 that reminded me a type-dependent `true` is fine. This PR splits the `OperandRef::builder` logic out to a separate type, with the updates needed to handle SIMD as well. In doing so, that makes the existing `Aggregate` path in `codegen_rvalue_operand` capable of handing SIMD values just fine. As a result, we no longer need to do layout calculations for aggregate result types when running the analysis to determine which things can be SSA in codegen.
2025-07-09Add opaque TypeId handles for CTFEOli Scherer-51/+131
2025-07-09use `--dynamic-list` for exporting executable symbolsusamoi-0/+30
2025-07-09Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrierilbors-0/+21
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors In rust-lang/rust#140106, deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However: - As of rust-lang/rust#143414, box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test. - External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default. In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter. r? `@Nadrieril`
2025-07-09tests: Don't check for self-printed output in std-backtrace.rs testMartin Nordholts-6/+2
The `Display` implementation for `Backtrace` used to print stack backtrace: but that print was later removed. To make the existing test pass, the print was added to the existing test. But it doesn't make sense to check for something that the test itself does since that will not detect any regressions in the implementation of `Backtrace`. Fully remove the checks.
2025-07-09Auto merge of #143667 - tgross35:rollup-yqitltm, r=tgross35bors-40/+124
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142357 (Simplify LLVM bitcode linker in bootstrap and add tests for it) - rust-lang/rust#143177 (Remove false label when `self` resolve failure does not relate to macro) - rust-lang/rust#143339 (Respect endianness correctly in CheckEnums test suite) - rust-lang/rust#143426 (clippy fix: indentation) - rust-lang/rust#143475 (tests: Use `cfg_target_has_reliable_f16_f128` in `conv-bits-runtime-const`) - rust-lang/rust#143499 (Don't call `predicates_of` on a dummy obligation cause's body id) - rust-lang/rust#143520 (Fix perf regression caused by tracing) - rust-lang/rust#143532 (More carefully consider span context when suggesting remove `&mut`) - rust-lang/rust#143606 (configure.py: Write last key in each section) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-08Rollup merge of #143532 - compiler-errors:mut-ref-sugg, r=davidtwcoTrevor Gross-0/+34
More carefully consider span context when suggesting remove `&mut` Use `find_ancestor_inside` to compute a relative span that is macro-aware, rather than falling back to using BytePos arithmetic which is wrong for `&mut`. Fixes https://github.com/rust-lang/rust/issues/143523
2025-07-08Rollup merge of #143499 - compiler-errors:predicates-of-crate, r=davidtwcoTrevor Gross-0/+37
Don't call `predicates_of` on a dummy obligation cause's body id See the test for a brief explanation Fixes rust-lang/rust#143481.
2025-07-08Rollup merge of #143475 - tgross35:runtime-test-config, r=jieyouxuTrevor Gross-23/+20
tests: Use `cfg_target_has_reliable_f16_f128` in `conv-bits-runtime-const` `conv-bits-runtime-const` gates `f16` and `f128` tests behind `x86_64`, but this isn't always accurate. In particular, x86 `MinGW` has an ABI bug [1] which means things work when linked to our Rust math libraries but don't work with host libraries. RUST-143405 slightly adjusts which targets we provide `f16` and `f128` symbols for and effectively removes MinGW from that list, meaning host libraries start getting linked, meaning `f16` and `f128` tests start to fail. Account for this by changing the gates in one such test to `cfg(target_has_reliable_{f16,f128})` which is the way we should be gating all behavior related to the types going forward. `rustfmt` also seems to have formatted the macros which is fine. [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054
2025-07-08Rollup merge of #143339 - 1c3t3a:issue-143332, r=RalfJungTrevor Gross-15/+14
Respect endianness correctly in CheckEnums test suite The endianness can change the test expectation for the enum check. This change is fixing the failing tests on big endian by changing the tests so that they behave the same as on little endian. Fixes rust-lang/rust#143332.
2025-07-08Rollup merge of #143177 - xizheyin:143134, r=lcnrTrevor Gross-2/+19
Remove false label when `self` resolve failure does not relate to macro Fixes rust-lang/rust#143134 In the first commit, I did some code-clean, moving `suggest*` to `suggestions/` dir. In the second, commit, I added ui test. In the third, I change the code, and present the test result. r? compiler
2025-07-09Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqkbors-10/+122
Apply effects to `otherwise` edge in dataflow analysis This allows `ElaborateDrops` to remove drops when a `match` wildcard arm covers multiple no-Drop enum variants. It modifies dataflow analysis to update the `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` data for a block reached through an `otherwise` edge. Fixes rust-lang/rust#142705.