summary refs log tree commit diff
path: root/tests/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2025-06-17make error codes reflect reality betterJana Dönszelmann-37/+50
2025-06-17use consistent attr errors in all attribute parsersJana Dönszelmann-1/+1
2025-06-17fix bugs in inline/force_inline and diagnostics of all attr parsersJana Dönszelmann-3/+16
2025-06-14Rollup merge of #142464 - RalfJung:variadic-fn-abi-error, r=workingjubileeMatthias Krüger-1/+1
variadic functions: remove list of supported ABIs from error I think this list is problematic for multiple reasons: - It is bound to go out-of-date as it is in a very different place from where we actually define which functions support varagrs (`fn supports_varargs`). - Many of the ABIs we list only work on some targets; it makes no sense to mention "aapcs" as a possible ABI when building for x86_64. (This led to a lot of confusion in https://github.com/rust-lang/rust/issues/110505 where the author thought they should use "cdecl" and then were promptly told that "cdecl" is not a legal ABI on their target.) - Typically, when the programmer wrote `extern "foobar"`, it is because they need the "foobar" ABI. It is of little use to tell them that there are other ABIs with which varargs would work. Cc ``@workingjubilee``
2025-06-13variadic functions: remove list of supported ABIs from errorRalf Jung-1/+1
2025-06-13Unimplement unsized_localsmejrs-10/+3
2025-06-08Auto merge of #142008 - RalfJung:const-eval-error-here, r=oli-obkbors-2/+2
const-eval error: always say in which item the error occurred I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const. r? `@oli-obk`
2025-06-07intrinsics: use const generic to set atomic orderingRalf Jung-15/+0
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-2/+2
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-06reword suggestion messageEsteban Küber-2/+2
2025-06-06Make cast suggestions verboseEsteban Küber-7/+13
``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ```
2025-06-04Rollup merge of #141888 - ferrocene:lw/decouple-tests-from-2015, ↵Matthias Krüger-6/+6
r=compiler-errors Use non-2015 edition paths in tests that do not test for their resolution This allows for testing these tests on editions other than 2015
2025-06-03Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJungMatthias Krüger-12/+9
Use the informative error as the main const eval error message r? `@RalfJung` I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
2025-06-03Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-6/+6
This allows for testing these tests on editions other than 2015
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-2/+2
2025-06-02Use the informative error as the main const eval error messageOli Scherer-12/+9
2025-06-02Add missing `dyn` keywords to tests that do not test for themLukas Wirth-14/+14
This ensures that these tests can be run on editions other than 2015
2025-05-28Stabilise `repr128`beetrees-10/+6
2025-05-23Do not try to confirm non-dyn compatible methodMichael Goulet-31/+2
2025-05-22Rollup merge of #140218 - fmease:hirtylo-clean-up-path-low, r=compiler-errorsMatthias Krüger-1/+7
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-07Better error message for late/early lifetime param mismatchMichael Goulet-11/+50
2025-05-07Point out region bound mismatches in check_region_bounds_on_impl_itemMichael Goulet-1/+5
2025-05-06Preserve generic args in suggestions for ambiguous associated itemsLeón Orell Valerian Liehr-1/+7
Most notably, this preserves the `(..)` of ambiguous RTN paths.
2025-05-02resolve: Support imports of associated types and glob imports from traitsVadim Petrochenkov-19/+0
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-10/+15
2025-04-13UI tests: migrate remaining compile time `error-pattern`s to line annotationsVadim Petrochenkov-5/+8
when possible.
2025-04-10Rollup merge of #139530 - oli-obk:rustc-intrinsic-cleanup, r=RalfJungMatthias Krüger-23/+0
Remove some dead or leftover code related to rustc-intrinsic abi removal r? ```@RalfJung``` PR that removed the ABI: https://github.com/rust-lang/rust/pull/139455 tracking issue: https://github.com/rust-lang/rust/issues/132735
2025-04-09Remove some dead or leftover code related to rustc-intrinsic abi removalOli Scherer-23/+0
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-9/+9
2025-04-06update/bless testsBennet Bleßmann-23/+29
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-1/+4
2025-03-16Rollup merge of #138471 - spencer3035:move-ui-test-1ofn, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+67
Clean up some tests in tests/ui I cleaned up 3 top level tests, keeping the changes minor because it is my first PR and wanted to get feedback before doing more changes/PRs. Tracking issues: https://github.com/rust-lang/rust/issues/73494 https://github.com/rust-lang/rust/issues/133895 r? jieyouxu
2025-03-15improves duplicate lang item testSpencer-0/+36
2025-03-15improves duplicate label testSpencer-0/+31
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-2/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-03-12Disentangle ForwardGenericParamBan and ConstParamTy ribsMichael Goulet-2/+2
2025-03-06`TypeVerifier` do not walk into required constslcnr-1/+1
2025-03-04tests: rebless some tests as a side-effect of `TEST_BUILD_DIR` changes许杰友 Jieyou Xu (Joe)-7/+7
2025-03-04tests: remove explicit long type filename hash normalization from some ui tests许杰友 Jieyou Xu (Joe)-3/+2
2025-03-01Rollup merge of #137617 - BoxyUwU:generic_const_parameter_types, r=lcnrMatthias Krüger-2/+0
Introduce `feature(generic_const_parameter_types)` Allows to define const generic parameters whose type depends on other generic parameters, e.g. `Foo<const N: usize, const ARR: [u8; N]>;` Wasn't going to implement for this for a while until we could implement it with `bad_inference.rs` resolved but apparently the project simd folks would like to be able to use this for some intrinsics and the inference issue isn't really a huge problem there aiui. (cc ``@workingjubilee`` )
2025-02-28Introduce `feature(generic_const_parameter_types)`Boxy-2/+0
2025-02-27remove most `simd_` intrinsic declaration in testsFolkert de Vries-8/+8
instead, we can just import the intrinsics from core
2025-02-25Make E0614 a structured errorEsteban Küber-1/+1
``` error[E0614]: type `(..., ..., ..., ...)` cannot be dereferenced --> $DIR/long-E0614.rs:10:5 | LL | *x; | ^^ can't be dereferenced | = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt' = note: consider using `--verbose` to print the full type name to the console ```
2025-02-25Auto merge of #137573 - compiler-errors:rollup-noq9yhp, r=compiler-errorsbors-38/+18
Rollup of 11 pull requests Successful merges: - #136522 (Remove `feature(dyn_compatible_for_dispatch)` from the compiler) - #137289 (Consolidate and improve error messaging for `CoerceUnsized` and `DispatchFromDyn`) - #137321 (Correct doc about `temp_dir()` behavior on Android) - #137417 (rustc_target: Add more RISC-V atomic-related features) - #137489 (remove `#[rustc_intrinsic_must_be_overridde]`) - #137530 (DWARF mixed versions with LTO on MIPS) - #137543 (std: Fix another new symlink test on Windows) - #137548 (Pass correct `TypingEnv` to `InlineAsmCtxt`) - #137550 (Don't immediately panic if dropck fails without returning errors) - #137552 (Update books) - #137556 (rename simd_shuffle_generic → simd_shuffle_const_generic) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-24Rollup merge of #137489 - ↵Michael Goulet-14/+8
RalfJung:no-more-rustc_intrinsic_must_be_overridden, r=oli-obk remove `#[rustc_intrinsic_must_be_overridde]` In https://github.com/rust-lang/rust/pull/135031, we gained support for just leaving away the body. Now that the bootstrap compiler got bumped, stop using the old style and remove support for it. r? `@oli-obk` There are a few more mentions of this attribute in RA code that I didn't touch; Cc `@rust-lang/rust-analyzer`
2025-02-24Consolidate and rework CoercePointee and DispatchFromDyn errorsMichael Goulet-24/+10
2025-02-24Fix test output expectationsJana Dönszelmann-15/+5
2025-02-24remove support for rustc_intrinsic_must_be_overridden from the compilerRalf Jung-14/+8
2025-02-21Trim suggestion part before generating highlightsMichael Goulet-2/+2
2025-02-21More sophisticated span trimmingMichael Goulet-43/+28