about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-08-23Use unnamed lifetime spans as primary spans for MISMATCHED_LIFETIME_SYNTAXESMichael Goulet-119/+116
2025-08-24Prefer verbose suggestions for `integer_to_ptr_transmutes` lintUrgau-36/+72
2025-08-24Allow `integer_to_ptr_transmutes` in testsUrgau-0/+1
2025-08-24Add lint against integer to pointer transmutesUrgau-0/+265
2025-08-23Rollup merge of #145791 - samueltardieu:fix-zst-to-enum-mir-validation, ↵Samuel Tardieu-0/+26
r=compiler-errors Fix ICE when validating transmuting ZST to inhabited enum MIR validation attempts to determine the number of bytes needed to represent the size of the source type to compute the discriminant for the inhabited target enum. For a ZST source, there is no source data to use as a discriminant so no proper runtime check can be generated. Since that should never be possible, insert a delayed bug to ensure the problem has been properly reported to the user by the type checker. Fixes rust-lang/rust#145786
2025-08-23Rollup merge of #145713 - lcnr:const-trait-bootstrap, r=compiler-errorsSamuel Tardieu-0/+53
next-solver: fix `feature(const_trait_impl)` bootstrap rarw r? ``@compiler-errors`` ``@fee1-dead``
2025-08-23Rollup merge of #145670 - jdonszelmann:port-sanitize, r=lcnrSamuel Tardieu-64/+96
port `sanitize` attribute to the new parsing infrastructure
2025-08-23Rollup merge of #145234 - dianne:1-tuple-witnesses, r=jackh726Samuel Tardieu-8/+8
match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little) Constructor patterns of type `(T,)` are written `(pat,)`, not `(pat)`. However, exhaustiveness/usefulness diagnostics would print them as `(pat)` when e.g. providing a witness of non-exhaustiveness and suggesting adding arms to make matches exhaustive; this would result in an error when applied. rust-analyzer already prints the trailing comma, so it doesn't need changing. This also includes some cleanup in the second commit, with justification in the commit message.
2025-08-23Auto merge of #145706 - lcnr:uniquification, r=BoxyUwUbors-11/+9
change HIR typeck region uniquification handling approach rust-lang/rust#144405 causes structural lookup of opaque types to not work during HIR typeck, so instead avoid uniquifying goals and instead only reprove them if MIR borrowck actually encounters an error. This doesn't perfectly maintain the property that HIR typeck succeeding implies that MIR typeck succeeds, instead weakening this check to only guarantee that HIR typeck implies that MIR typeck succeeds modulo region uniquification. This means we still get the actually desirable ICEs if we MIR building is broken or we forget to check some property in HIR typeck, without having to deal with the fallout of uniquification in HIR typeck itself. We report errors using the original obligation sources of HIR typeck so diagnostics aren't that negatively impacted either. Here's the history of region uniquification while working on the new trait solver: - rust-lang/rust#107981 - rust-lang/rust#110180 - rust-lang/rust#114117 - rust-lang/rust#130821 - rust-lang/rust#144405 - rust-lang/rust#145706 <- we're here :tada: r? `@BoxyUwU`
2025-08-23Fix ICE when validating transmuting ZST to inhabited enumSamuel Tardieu-0/+26
MIR validation attempts to determine the number of bytes needed to represent the size of the source type to compute the discriminant for the inhabited target enum. For a ZST source, there is no source data to use as a discriminant so no proper runtime check can be generated. Since that should never be possible, insert a delayed bug to ensure the problem has been properly reported to the user by the type checker.
2025-08-23Implement some more checks for `ptr_guaranteed_cmp` in consteval:Zachary S-30/+208
Pointers with different residues modulo their least common allocation alignment are never equal. Pointers to the same static allocation are equal if and only if they have the same offset. Strictly in-bounds (in-bounds and not one-past-the-end) pointers to different static allocations are always unequal. A pointer cannot be equal to an integer if `ptr-int` cannot be null. Also adds more tests for `ptr_guaranteed_cmp`. Co-authored-by: Ralf Jung <post@ralfj.de>
2025-08-23Account for impossible bounds making seemingly unsatisfyable dyn-to-dyn castsMichael Goulet-0/+16
2025-08-23port attribute to the new parsing infrastructureJana Dönszelmann-64/+96
2025-08-23Auto merge of #145773 - jhpratt:rollup-kocqnzv, r=jhprattbors-335/+2353
Rollup of 28 pull requests Successful merges: - rust-lang/rust#132087 (Fix overly restrictive lifetime in `core::panic::Location::file` return type) - rust-lang/rust#137396 (Recover `param: Ty = EXPR`) - rust-lang/rust#137457 (Fix host code appearing in Wasm binaries) - rust-lang/rust#142185 (Convert moves of references to copies in ReferencePropagation) - rust-lang/rust#144648 (Implementation: `#[feature(nonpoison_rwlock)]`) - rust-lang/rust#144897 (print raw lifetime idents with r#) - rust-lang/rust#145218 ([Debuginfo] improve enum value formatting in LLDB for better readability) - rust-lang/rust#145380 (Add codegen-llvm regression tests) - rust-lang/rust#145573 (Add an experimental unsafe(force_target_feature) attribute.) - rust-lang/rust#145597 (resolve: Remove `ScopeSet::Late`) - rust-lang/rust#145633 (Fix some typos in LocalKey documentation) - rust-lang/rust#145641 (On E0277, point at type that doesn't implement bound) - rust-lang/rust#145669 (rustdoc-search: GUI tests check for `//` in URL) - rust-lang/rust#145695 (Introduce ProjectionElem::try_map.) - rust-lang/rust#145710 (Fix the ABI parameter inconsistency issue in debug.rs for LoongArch64) - rust-lang/rust#145726 (Experiment: Reborrow trait) - rust-lang/rust#145731 (Make raw pointers work in type-based search) - rust-lang/rust#145736 (triagebot: Update style team reviewers) - rust-lang/rust#145738 (Uplift rustc_mir_transform::coverage::counters::union_find to rustc_data_structures.) - rust-lang/rust#145742 (rustdoc js: Even more typechecking improvments ) - rust-lang/rust#145743 (doc: fix some typos in comment) - rust-lang/rust#145745 (tests: Ignore basic-stepping.rs on LoongArch) - rust-lang/rust#145747 (Refactor lint buffering to avoid requiring a giant enum) - rust-lang/rust#145751 (fix(lexer): Allow '-' in the frontmatter infostring continue set) - rust-lang/rust#145761 (Add aarch64_be-unknown-hermit target) - rust-lang/rust#145762 (convert strings to symbols in attr diagnostics) - rust-lang/rust#145763 (Ship LLVM tools for the correct target when cross-compiling) - rust-lang/rust#145765 (Revert suggestions for missing methods in tuples) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-22Rollup merge of #145765 - lqd:revert-142034, r=fmeaseJacob Pratt-97/+109
Revert suggestions for missing methods in tuples As requested by `@estebank` and as discussed with `@jackh726,` this reverts rust-lang/rust#142034 because of diagnostics ICEs like rust-lang/rust#142488 and its duplicates that have reached stable by now. We will work on a proper fix to reland this cool work in the near future, but in the meantime, a revert is safer to validate and backport to beta and stable, so here it is.
2025-08-22Rollup merge of #145751 - epage:infostring, r=joshtriplettJacob Pratt-0/+28
fix(lexer): Allow '-' in the frontmatter infostring continue set This more closely matches the RFC and what our T-lang contact has asked for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312 Tracking issue: rust-lang/rust#136889
2025-08-22Rollup merge of #145726 - aapoalas:reborrow-lang-experiment, r=petrochenkovJacob Pratt-0/+16
Experiment: Reborrow trait Tracking issue: rust-lang/rust#145612 Starting off really small here: just introduce the unstable feature and the feature gate, and one of the two traits that the Reborrow experiment deals with. ### Cliff-notes explanation The `Reborrow` trait is conceptually a close cousin of `Copy` with the exception that it disables the source (`self`) for the lifetime of the target / result of the reborrow action. It can be viewed as a method of `fn reborrow(self: Self<'a>) -> Self<'a>` with the compiler adding tracking of the resulting `Self<'a>` (or any value derived from it that retains the `'a` lifetime) to keep the `self` disabled for reads and writes. No method is planned to be surfaced to the user, however, as reborrowing cannot be seen in code (except for method calls [`a.foo()` reborrows `a`] and explicit reborrows [`&*a`]) and thus triggering user-code in it could be viewed as "spooky action at a distance". Furthermore, the added compiler tracking cannot be seen on the method itself, violating the Golden Rule. Note that the userland "reborrow" method is not True Reborrowing, but rather a form of a "Fancy Deref": ```rust fn reborrow(&'short self: Self<'long>) -> Self<'short>; ``` The lifetime shortening is the issue here: a reborrowed `Self` or any value derived from it is bound to the method that called `reborrow`, since `&'short` is effectively a local variable. True Reborrowing does not shorten the lifetime of the result. To avoid having to introduce new kinds of references, new kinds of lifetime annotations, or a blessed trait method, no method will be introduced at all. Instead, the `Reborrow` trait is intended to be a derived trait that effectively reborrows each field individually; `Copy` fields end up just copying, while fields that themselves `Reborrow` get disabled in the source, usually leading to the source itself being disabled (some differences may appear with structs that contain multiple reborrowable fields). The goal of the experiment is to determine how the actual implementation here will shape out, and what the "bottom case" for the recursive / deriving `Reborrow` is. `Reborrow` has a friend trait, `CoerceShared`, which is equivalent to a `&'a mut T -> &'a T` conversion. This is needed as a different trait and different operation due to the different semantics it enforces on the source: a `CoerceShared` operation only disables the source for writes / exclusive access for the lifetime of the result. That trait is not yet introduced in this PR, though there is no particular reason why it could not be introduced.
2025-08-22Rollup merge of #145710 - heiher:issue-145692-2, r=nnethercoteJacob Pratt-25/+1019
Fix the ABI parameter inconsistency issue in debug.rs for LoongArch64 Issue: rust-lang/rust#145692
2025-08-22Rollup merge of #145641 - estebank:point-at-type-in-e0277, r=davidtwcoJacob Pratt-189/+976
On E0277, point at type that doesn't implement bound When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
2025-08-22Rollup merge of #145573 - veluca93:unsafe-force-target-feature, r=davidtwcoJacob Pratt-0/+99
Add an experimental unsafe(force_target_feature) attribute. This uses the feature gate for https://github.com/rust-lang/rust/issues/143352, but is described in https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to the experiment.
2025-08-22Rollup merge of #144897 - fee1-dead-contrib:raw_lifetimes_printing, r=fmeaseJacob Pratt-16/+79
print raw lifetime idents with r# This replaces rust-lang/rust#143185 and fixes rust-lang/rust#143150 cc ``@fmease``
2025-08-22Rollup merge of #144648 - connortsui20:nonpoison_rwlock, r=Mark-SimulacrumJacob Pratt-8/+8
Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: https://github.com/rust-lang/rust/issues/134645 This PR continues the effort made in https://github.com/rust-lang/rust/pull/144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: https://github.com/rust-lang/rust/pull/144651 - `nonpoison_once` implementation: https://github.com/rust-lang/rust/pull/144653
2025-08-22Rollup merge of #137396 - compiler-errors:param-default, r=fmeaseJacob Pratt-0/+19
Recover `param: Ty = EXPR` Fixes #137310 Pretty basic recovery here, but better than giving an unexpected token error.
2025-08-22add regression test for issue 142488Rémy Rakic-0/+109
there are a lot of MCVEs there, so this is only a few of them, not all duplicates that were opened
2025-08-22Revert "Detect method not being present that is present in other tuple types"Rémy Rakic-97/+0
This reverts commit 585a40963ea59808e74803f8610659a505b145e0.
2025-08-22Fix stderr normalization.Camille Gillot-5/+5
2025-08-22Separate transmute checking from typeck.Camille Gillot-135/+125
2025-08-22Recover param: Ty = EXPRMichael Goulet-0/+19
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-189/+976
When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
2025-08-22ci: Begin running ui tests with `rust.debuginfo-level-tests=1`Martin Nordholts-3/+19
To reduce risk of regressing on generating debuginfo e.g. in the form of ICE:s. This will also ensure that future ui tests support different debuginfo levels. When I looked at run time for different CI jobs, **x86_64-gnu-debug** was far from the bottle neck, so it should be fine to make it perform more work.
2025-08-22fix(lexer): Allow '-' in the infostring continue setEd Page-12/+2
This more closely matches the RFC and what our T-lang contact has asked for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312
2025-08-22test(frontmatter): Show current hyphen behaviorEd Page-0/+38
2025-08-22change HIR typeck unification handling approachlcnr-11/+9
2025-08-22Region inference: Use outlives-static constraints in constraint searchAmanda Stjerna-28/+25
Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive 'static.
2025-08-22Auto merge of #144689 - JonathanBrouwer:share_parse_path, r=jdonszelmannbors-147/+193
Rewrite the new attribute argument parser Fixes https://github.com/rust-lang/rust/issues/143940 This rewrites the parser, should improve performance and maintainability. This can be reviewed commit by commit
2025-08-22Auto merge of #145358 - Kobzol:symbol-name-sort, r=nnethercotebors-40/+40
Sort mono items by symbol name Trying to claw back cycles/branch/cache miss losses from https://github.com/rust-lang/rust/pull/144722.
2025-08-22Updated uitests for new parserJonathan Brouwer-147/+193
2025-08-22address review commentsDeadbeef-16/+16
2025-08-22don't print invalid labels with `r#`Deadbeef-14/+14
2025-08-22print raw lifetime idents with `r#`Deadbeef-0/+63
2025-08-22Add an experimental unsafe(force_target_feature) attribute.Luca Versari-0/+99
This uses the feature gate for https://github.com/rust-lang/rust/issues/143352, but is described in https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to the experiment.
2025-08-21Rollup merge of #145700 - nnethercote:fix-145696, r=lcnrJacob Pratt-1/+17
Handle `ReEarlyParam` in `type_name`. Fixes rust-lang/rust#145696. r? `@lcnr`
2025-08-21Rollup merge of #145672 - compiler-errors:query-instab-ice, r=lcnrJacob Pratt-0/+11
Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability Fixes https://github.com/rust-lang/rust/issues/145652 which was introduced by https://github.com/rust-lang/rust/pull/139345 because we were skipping a binder before calling `Instance::try_resolve`. r? lcnr
2025-08-21Rollup merge of #145661 - folkertdev:s390x-codegen-test-cleanup, r=dianqkJacob Pratt-9/+9
update some s390x codegen tests By using `minicore`, `&raw` and removing use of `link_llvm_intrinsics`
2025-08-21Rollup merge of #145604 - compiler-errors:static-closure, r=fmeaseJacob Pratt-22/+60
Gate static closures behind a parser feature I'd like to gate `static ||` closures behind a feature gate, since we shouldn't allow people to take advantage of this syntax if it's currently unstable. Right now, since it's only rejected after ast lowering, it's accessible to macros. Let's crater this to see if we can claw it back without breaking anyone's code.
2025-08-21Rollup merge of #145507 - jdonszelmann:refactor-attr-parsing, r=davidtwcoJacob Pratt-130/+130
Refactor attribute parsing to improve ergonomics and some diagnostics
2025-08-21Rollup merge of #144541 - ↵Jacob Pratt-0/+77
folkertdev:c-variadic-same-program-multiple-abis-arm, r=RalfJung,davidtwco c-variadic: multiple ABIs in the same program for arm similar to https://github.com/rust-lang/rust/pull/144379, but for arm, requested in https://github.com/rust-lang/rust/pull/144066. Quoting https://github.com/rust-lang/reference/issues/1946#issuecomment-3124555690 > `"aapcs"` specifically refers to the soft-float ABI where floating-point values are passed in integer registers. However for c-variadic functions, `aapcs` behaves the same as `C`: https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#65parameter-passing > A variadic function is always marshaled as for the base standard. https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#7the-standard-variants > This section applies only to non-variadic functions. For a variadic function the base standard is always used both for argument passing and result return. --- I also noticed that rustc currently emit more instructions than clang for c-variadic functions on arm, see https://godbolt.org/z/hMce9rnTh. I'll fix that separately. (edit: https://github.com/rust-lang/rust/pull/144549) try-job: armhf-gnu r? `@RalfJung`
2025-08-22Add reborrow feature gate testAapo Alasuutari-0/+16
2025-08-21next-solver fix const_trait_impl bootstraplcnr-0/+53
2025-08-21Fix the ABI parameter inconsistency issue in debug.rs for LoongArch64WANG Rui-25/+1019