about summary refs log tree commit diff
path: root/tests/ui/recursion
AgeCommit message (Collapse)AuthorLines
2025-08-17Rehome tests/ui/issues/ tests [5/?]Oneirical-0/+43
2025-08-08Rollup merge of #144039 - estebank:short-paths, r=fee1-deadTrevor Gross-8/+16
Use `tcx.short_string()` in more diagnostics `TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`. We add support for shortening the path of "trait path only". Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem).
2025-08-07Use `tcx.short_string()` in more diagnosticsEsteban Küber-8/+16
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`. We add support for shortening the path of "trait path only". Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem). When we don't actually print out a shortened type we don't need the "use `--verbose`" note. On E0599 show type identity to avoid expanding the receiver's generic parameters. Unify wording on `long_ty_path` everywhere.
2025-08-06Add support for shortening `Instance` and use itEsteban Küber-6/+8
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
2025-07-24Rehome tests/ui/issues/ tests [1/?]Oneirical-0/+50
2025-07-13cleaned up some testsKivooeo-6/+30
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
2025-07-13moved testsKivooeo-0/+25
2025-06-27const-eval: error when initializing a static writes to that staticRalf Jung-4/+4
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-04Rollup merge of #141960 - ferrocene:lw/2015-paths2, r=compiler-errorsMatthias Krüger-1/+1
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 Follow up to https://github.com/rust-lang/rust/pull/141888
2025-06-03Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-1/+1
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-6/+6
2025-04-21Cleaned up 5 tests in `tests/ui`reddevilmidzy-0/+21
2025-03-04tests: remove explicit long type filename hash normalization from some ui tests许杰友 Jieyou Xu (Joe)-14/+10
2025-01-30normalize long-type.txt in testsRémy Rakic-4/+5
this allows compare-mode to share the same subdirectory and removes differences due to that
2025-01-27Remove all dead files inside tests/ui/León Orell Valerian Liehr-30/+0
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-3/+3
2024-12-08bless test expectationsRémy Rakic-4/+4
(in a separate commit for easier review, one of them is huge)
2024-12-08mark previously hanging tests as good to goRémy Rakic-2/+1
2024-12-06Remove polymorphizationBen Kimock-1/+1
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-1/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-23Update tests for new TRPL chapter orderChris Krycho-1/+1
2024-11-05Tweak E0320 overflow error wordingEsteban Küber-3/+3
Surrount type with backticks as we should in every error.
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-2/+2
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-07-12Gate the type length limit check behind a nightly flagMichael Goulet-9/+8
2024-07-02Re-implement a type-size based limitMichael Goulet-9/+12
2024-04-21Move some testsCaio-0/+56
2024-04-07Move testsCaio-0/+92
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-16/+16
2024-02-15Do not allocate a second "background" alloc id for the main allocation of a ↵Oli Scherer-15/+18
static. Instead we re-use the static's alloc id within the interpreter for its initializer to refer to the `Allocation` that only exists within the interpreter.
2024-02-15Return ConstAllocation from eval_static_initializer query directlyOli Scherer-7/+2
2024-02-15Add new query just for static initializersOli Scherer-4/+9
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-2/+2
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-19Always use RevealAll for const eval queriesOli Scherer-7/+2
2023-12-18Adjust the ignore-compare-mode-next-solver for hangsMichael Goulet-1/+0
2023-11-24Manual find replace updatesNilstrieb-2/+2
2023-11-24Show number in error message even for one errorNilstrieb-8/+8
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-3/+3
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-2/+0
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-09Suggest using `Arc` on `!Send`/`!Sync` typesEsteban Kuber-0/+2
2023-07-26Auto merge of #113893 - mdibaiee:type-name-spill-flag, r=compiler-errorsbors-2/+1
new unstable option: -Zwrite-long-types-to-disk This option guards the logic of writing long type names in files and instead using short forms in error messages in rustc_middle/ty/error behind a flag. The main motivation for this change is to disable this behaviour when running ui tests. This logic can be triggered by running tests in a directory that has a long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/ This means ui tests can fail depending on how long the path to their file is. Some ui tests actually rely on this behaviour for their assertions, so for those we enable the flag manually.
2023-07-25write-long-types-to-disk: update testsMahdi Dibaiee-3/+2
2023-07-24new unstable option: -Zwrite-long-types-to-diskMahdi Dibaiee-1/+1
This option guards the logic of writing long type names in files and instead using short forms in error messages in rustc_middle/ty/error behind a flag. The main motivation for this change is to disable this behaviour when running ui tests. This logic can be triggered by running tests in a directory that has a long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/ This means ui tests can fail depending on how long the path to their file is. Some ui tests actually rely on this behaviour for their assertions, so for those we enable the flag manually.
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-10/+10
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21add `naive_layout_of` queryMoulins-10/+10
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-6/+2
2023-07-18added links as a notenxya-2/+2
2023-07-18add links to query documentation for E0391nxya-2/+2
2023-07-18added links as a notenxya-2/+9