about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2025-05-26Support opaque_types_defined_by for SyntheticCoroutineBodyMichael Goulet-0/+13
2025-05-26cfg_version: pull out dedicated syntax test from feature gate testJieyou Xu-243/+350
The feature gate test was dual-purposing causing feature gate errors to distract from syntax exercises.
2025-05-26Deduplicate dyn compatibility violations due to coercionMichael Goulet-765/+57
2025-05-25const-check: stop recommending the use of rustc_allow_const_fn_unstableRalf Jung-240/+40
2025-05-26Add compiler tests for xrayquininer-10/+27
2025-05-25Fix `unused_braces` lint suggestion when encountering attributesUrgau-0/+49
2025-05-25Make UNNECESSARY_TRANSMUTES into a HIR lintMichael Goulet-56/+170
2025-05-25Make PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS into a HIR lintMichael Goulet-39/+26
2025-05-25Improve `ambiguous_wide_pointer_comparisons` lint compare diagnosticsUrgau-25/+125
2025-05-25Rollup merge of #141512 - Noratrieb:stop-trimming-this-much, r=compiler-errorsGuillaume Gomez-40/+60
Avoid extra path trimming in method not found error Method errors have an extra check that force trim paths whenever the normal string is longer than 10 characters, which can be quite unhelpful when multiple items have the same name (for example an `Error`). A user reported this force trimming as being quite unhelpful when they had a method error where the precise path of the `Error` mattered. The code uses `tcx.short_string` already to get the normal path, which tries to be clever around trimming paths if necessary, so there is no reason for this extra force trimming.
2025-05-24Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRINGest31-0/+47
2025-05-24Avoid extra path trimming in method not found errorNoratrieb-40/+60
Method errors have an extra check that force trim paths whenever the normal string is longer than 10 characters, which can be quite unhelpful when multiple items have the same name (for example an `Error`). A user reported this force trimming as being quite unhelpful when they had a method error where the precise path of the `Error` mattered. The code uses `tcx.short_string` already to get the normal path, which tries to be clever around trimming paths if necessary, so there is no reason for this extra force trimming.
2025-05-24Auto merge of #141372 - khuey:ir_call_dbg_loc, r=jieyouxubors-0/+12
Use the fn_span when emitting function calls for better debug info. This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc. try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc-1 try-job: arm-android r? `@jieyouxu`
2025-05-24Disable test on android because it doesn't have backtraces.Kyle Huey-1/+2
2025-05-24Add ui test func-pointer-issue-140491xizheyin-0/+16
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-24Rollup merge of #141456 - Urgau:check-cfg-version-pred, r=jieyouxuMatthias Krüger-0/+45
Suggest correct `version("..")` predicate syntax in check-cfg This PR specialize the `unexpected_cfgs` lint diagnostic to suggest correct `version("..")` predicate syntax when providing the key-value one, eg. `version = "1.27"`. Fixes https://github.com/rust-lang/rust/issues/141440 r? ``@jieyouxu``
2025-05-24Rollup merge of #141438 - compiler-errors:dyn-compatible-call, r=lcnrMatthias Krüger-304/+83
Do not try to confirm non-dyn compatible method See the comment I left in `compiler/rustc_hir_typeck/src/method/confirm.rs`. If we have a receiver that does not deref to the `dyn Trait` we're assembling the method from, then we used to ICE, but that's something that is possible to encounter with arbitrary self types. r? oli-obk Fixes https://github.com/rust-lang/rust/issues/141419
2025-05-24Rollup merge of #141429 - ↵Matthias Krüger-0/+30
compiler-errors:unsafe-binder-non-structural-match, r=spastorino Dont walk into unsafe binders when emiting error for non-structural type match Fixes #141422. The other two binder-having types are also special cased here, unsurprisingly. r? oli-obk
2025-05-24Enable xray support for Macquininer-1/+1
* https://maskray.me/blog/2023-06-18-port-llvm-xray-to-apple-systems * https://github.com/llvm/llvm-project/blob/llvmorg-20.1.4/clang/lib/Driver/XRayArgs.cpp#L31
2025-05-23Suggest correct `version("..")` predicate syntax in check-cfgUrgau-0/+45
2025-05-23Do not try to confirm non-dyn compatible methodMichael Goulet-304/+83
2025-05-23Rollup merge of #140967 - ↵Matthias Krüger-0/+40
azhogin:azhogin/async-drop-poll-shim-for-error-dropee-fix, r=oli-obk Async drop poll shim for error dropee generates noop body Fixes https://github.com/rust-lang/rust/issues/140930. When dropee type for async drop poll shim is `ty::Error(_)`, the generated poll function will be noop body. To avoid ICE in `elaborate_drop`.
2025-05-23Emit dummy open drop for unsafe binderMichael Goulet-0/+29
2025-05-23Properly analyze captures from unsafe bindersMichael Goulet-0/+21
2025-05-23Dont walk into unsafe binders when emiting error for non-structural type matchMichael Goulet-0/+30
2025-05-23Auto merge of #140553 - BoxyUwU:defer_type_system_ctfe, r=compiler-errorsbors-53/+388
Defer evaluating type system constants when they use infers or params Split out of #137972, the parts necessary for associated const equality and min generic const args to make progress and have correct semantics around when CTFE is invoked. According to a [previous perf run](https://perf.rust-lang.org/compare.html?start=93257e2d20809d82d1bc0fcc1942480d1a66d7cd&end=01b4cbf0f47c3f782330db88fa5ba199bba1f8a2&stat=instructions:u) of adding the new `const_arg_kind` query we should expect minor regressions here. I think this is acceptable as we should be able to remove this query relatively soon once mgca is more complete as we'll then be able to implement GCE in terms of mgca and rip out `GCEConst` at which point it's trivial to determine what kind of anon const we're dealing with (either it has generics and is a repeat expr hack, or it doesnt and is a normal anon const). This should only affect unstable code as we handle repeat exprs specially and those are the only kinds of type system consts that are allowed to make use of generic parameters. Fixes #133066 Fixes #133199 Fixes #136894 Fixes #137813 r? compiler-errors
2025-05-23Auto merge of #135160 - RalfJung:aarch64-softfloat-not-neon, r=Noratriebbors-0/+45
aarch64-softfloat: forbid enabling the neon target feature This fixes https://github.com/rust-lang/rust/issues/134375 in a rather crude way, by making [the example](https://godbolt.org/z/r56xWo8nT) not build any more on aarch64-unknown-none-softfloat. That is a breaking change since the "neon" aarch64 target feature is stable, but this is justified as a soundness fix. Note that it's not "neon" which is problematic but "fp-armv8"; however, the two are tied together by rustc. `-Ctarget-feature=+neon` still works, it just causes a warning (but one that we do hope to make a hard error eventually). Only `#[target_feature="neon"]` becomes a hard error with this PR. More work on the LLVM side will be needed before we can let people use neon without impacting the ABI of float values (and, in particular, the ABI used by automatically inserted calls to libm functions, e.g. for int-to-float casts, which rustc has no control over). Nominating for `@rust-lang/lang` since it is a breaking change. As-is this PR doesn't have a warning cycle; the hope is that the aarch64-unknown-none-softfloat target is sufficiently niche that there's no huge fallout and we can easily revert if it causes trouble. A warning cycle could be added but would need some dedicated rather hacky check in the target_feature attribute handling logic. try-job: dist-various-1
2025-05-22Use the fn_span when emitting function calls for better debug info.Kyle Huey-0/+11
This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc.
2025-05-22Auto merge of #141396 - matthiaskrgr:rollup-feg050g, r=matthiaskrgrbors-188/+807
Rollup of 7 pull requests Successful merges: - #135562 (Add ignore value suggestion in closure body) - #139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - #139668 (Handle regions equivalent to 'static in non_local_bounds) - #140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - #140435 (use uX::from instead of _ as uX in non - const contexts) - #141130 (rustc_on_unimplemented cleanups) - #141286 (Querify `coroutine_hidden_types`) Failed merges: - #140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-23Async drop poll shim for error dropee generates noop body (fixes #140930)Andrew Zhogin-0/+40
2025-05-22Allow `#![doc(test(attr(..)))]` at every levelUrgau-10/+108
2025-05-22Allow `#![doc(test(attr(..)))]` at module level tooUrgau-0/+4
2025-05-22Fix future-incompatible lint group testUrgau-15/+35
2025-05-22Rollup merge of #141390 - compiler-errors:poly-select-new-solver, r=lcnrMatthias Krüger-0/+57
Don't allow `poly_select` in new solver I added a `poly_select` call in #140519, but this causes an ICE since the new solver doesn't properly handle the "instantiate binder -> recanonicalize" step in the proof tree visitor. While we could fix the select visitor to look at the next step in proof tree, it's not really necessary. Instead, let's enforce that all callees call the non-higher-ranked `select` function in the new solver. Fixes https://github.com/rust-lang/rust/issues/141322 r? lcnr
2025-05-22Rollup merge of #141362 - BoxyUwU:correct_error_term_kind, r=lcnrMatthias Krüger-0/+56
Normalize aliases to correct kind of error term Fixes #140642 When normalizing an alias to an error in the old solver, normalize to the same term kind as the alias being normalized instead of always to a type error. r? lcnr
2025-05-22Rollup merge of #141359 - compiler-errors:async-fn-once, r=lcnrMatthias Krüger-0/+15
Fix `FnOnce` impl for `AsyncFn`/`AsyncFnMut` self-borrowing closures in new solver This only affects closures that are "`AsyncFn`/`AsyncFnMut`" in their calling capability that are being called with the `FnOnce` trait. fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/217 r? lcnr
2025-05-22Rollup merge of #141130 - mejrs:use_self, r=compiler-errorsMatthias Krüger-49/+102
rustc_on_unimplemented cleanups Addresses some of the fixmes from https://github.com/rust-lang/rust/pull/139091 and https://github.com/rust-lang/rust/pull/140307. - switch from `_Self` to `Self` in library - properly validate that arguments in the `on` filter and the format strings are actually valid See https://github.com/rust-lang/rustc-dev-guide/pull/2357 for the relevant documentation.
2025-05-22Rollup merge of #140435 - ↵Matthias Krüger-43/+114
bend-n:use_ux_from_instead_of_bool_as_ux_unnecessary_transmutes, r=compiler-errors use uX::from instead of _ as uX in non - const contexts changes `transmute(bool) -> integer` to `integer::from` as opposed to `bool as integer`. https://github.com/rust-lang/rust/pull/136083#discussion_r1985061667 `@rustbot` label L-unnecessary_transmutes
2025-05-22Rollup merge of #140218 - fmease:hirtylo-clean-up-path-low, r=compiler-errorsMatthias Krüger-18/+124
HIR ty lowering: Clean up & refactor the lowering of type-relative paths While rebasing #126651 I realized that HIR ty lowering could benefit from some *spring cleaning* now that it's been extended to handle RTN and mGCA paths. More seriously, similar to my merged PR #118668 which unified the handling of all *associated item constraints* (assoc ty, const (ACE) & fn (RTN)), this PR (commit https://github.com/rust-lang/rust/pull/140218/commits/695fcf517d8864b4812225643ef8cfc036ba9f61) partially[^1] deduplicates the resolution code for all *type-relative paths* (assoc ty, const (mGCA) & fn (RTN)). **Why**? DRY'ing that part of the code means PR #126651 will automatically support RTN paths like `Ty::AssocTy::assoc_fn(..)` and it also implies shared diagnostic code and thus better diagnostics for RTN. --- The other commits represent cleanups, renamings, moves. More notably, I've renamed path lowering methods to be a lot more descriptive, so ones lowering `QPath(Resolved)` paths now have `_resolved_` in their name and ones lowering `QPath(TypeRelative)` paths now have `_type_relative_` in their name. This should make it stupidly obvious what their purpose is. --- Best reviewed commit by commit. The changes are close to trivial but the diff might make it look hairier. r? compiler-errors [^1]: Sadly, I couldn't unify as much compared to the other PR without introducing unnecessary `unreachable!()`s or rendering the code otherwise illegible with flags and micro helper traits.
2025-05-22Rollup merge of #139668 - matthewjasper:upper-bound-fix, r=compiler-errorsMatthias Krüger-0/+169
Handle regions equivalent to 'static in non_local_bounds `non_local_bounds` would only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In this case we should return 'static. closes #122704 closes #139004
2025-05-22Rollup merge of #139635 - BoxyUwU:no_order_dependent_copy_checks, r=lcnrMatthias Krüger-78/+260
Finalize repeat expr inference behaviour with inferred repeat counts I believe this should be the last change of how repeat exprs are handled before it's finished for `generic_arg_infer`. Assuming we don't wind up deciding to replace this all with a new predicate kind :) This PR has three actual changes: - Always defer the checks to end of typeck even when generic arg infer is not enabled (needs an FCP) - Properly handle element exprs that are constants when the repeat count is inferred - "Isolate" each repeat expr check so that inference constraints from `Copy` goals dont affect other repeat expr checks resulting in weird order-dependent inference The commit history and tests should be relatively helpful for understanding this PR's impl. r? compiler-errors
2025-05-22Rollup merge of #135562 - chenyukang:yukang-fix-128561, r=compiler-errorsMatthias Krüger-0/+38
Add ignore value suggestion in closure body Fixes #128561 r? `@estebank`
2025-05-22Add test/comment about const patterns with unused paramsBoxy-0/+19
2025-05-22Review CommentsBoxy-0/+2
2025-05-22Don't allow poly_select in new solverMichael Goulet-0/+57
2025-05-22Return correct error term kind on projection errorsBoxy-0/+56
2025-05-22ReviewsBoxy-2/+2
2025-05-22make enabling the neon target feature a FCWRalf Jung-0/+45
2025-05-22use uX::from instead of _ as uX in non - const contextsbendn-43/+114
2025-05-22Rollup merge of #140431 - bend-n:dont_handle_bool_transmute, r=NadrierilMatthias Krüger-12/+6
dont handle bool transmute removes `transmute(u8) -> bool` suggestion due to ambiguity, leave it for clippy elaboration on ambiguity in question: `transmute::<u8, bool>(x)` will codegen to an `assume(u8 < 2)`; `_ == 1` or `_ != 0` or `_ % 2 == 0` would remove that assumption `match _ { x @ (0 | 1) => x == 1, _ => std::hint::unreachable_unchecked() }` is very verbose `@rustbot` label L-unnecessary_transmutes