about summary refs log tree commit diff
path: root/tests/ui/fmt
AgeCommit message (Collapse)AuthorLines
2025-09-26Ignore more failing ui tests for GCC backendGuillaume Gomez-1/+2
2025-09-08Apply requested changesIoaNNUwU-4/+2
2025-09-08Implement better suggestions based on additional tests and other code pathsIoaNNUwU-0/+14
2025-08-27Fix format string grammar in docs and improve alignment error messageNilotpal Gupta-7/+15
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-2/+10
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-07-17cleaned up some testsKivooeo-1/+3
Reverting file name weird-exprs.rs due to its historical use, recognition in community and references
2025-07-14moved testsKivooeo-0/+13
2025-06-30Rollup merge of #143118 - Kivooeo:tf15, r=tgross35dianqk-0/+32
`tests/ui`: A New Order [15/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? `@jieyouxu`
2025-06-30cleaned up some testsKivooeo-2/+5
2025-06-28Move some UI tests to more apropriate directoriesTrevor Gross-0/+29
Prepare for rework done in the rest of [PR143118]. [PR143118]: https://www.github.com/rust-lang/rust/pull/143118 Co-authored-by: Kivooeo <Kivooeo123@gmail.com>
2025-06-22Implement DesugaringKind::FormatLiteralmejrs-6/+74
2025-06-11cleaned up some testsKivooeo-0/+34
2025-03-25compiletest: Support matching on diagnostics without a spanVadim Petrochenkov-0/+2
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-11/+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-02-21More sophisticated span trimmingMichael Goulet-3/+2
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-1/+1
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-3/+2
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-30/+45
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2024-12-30add suggestion for wrongly ordered format parametersDavis Muro-0/+85
2024-11-27Update tests to use new proc-macro headerEric Huss-12/+7
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-1/+1
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-10-21Rollup merge of #131697 - ShE3py:rt-arg-lifetimes, r=AmanieuJubilee-1/+1
`rt::Argument`: elide lifetimes `@rustbot` label +C-cleanup
2024-10-14Remove `'apostrophes'` from `rustc_parse_format`Lieselotte-69/+69
2024-10-14`rt::Argument`: elide lifetimesLieselotte-1/+1
2024-08-28fmt-debug optionKornel-0/+91
Allows disabling `fmt::Debug` derive and debug formatting.
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-1/+6
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-06Mark format! with must_use hintlukas-49/+49
2024-06-25fix UI test, simplify error messagejoboet-24/+6
2024-04-14Add more test casesninad-4/+26
2024-04-14Don't inline integer literals when out of rangeninad-0/+48
2024-04-12core: get rid of `USIZE_MARKER`joboet-0/+4
2024-03-27Use `TraitRef::to_string` sorting in favor of `TraitRef::ord`, as the latter ↵Oli Scherer-6/+6
compares `DefId`s which we need to avoid
2024-03-19Rollup merge of #122556 - jieyouxu:non-identifier-format-arg, r=petrochenkovMatthias Krüger-0/+33
Extend format arg help for simple tuple index access expression The help is only applicable for simple field access `a.b` and (with this PR) simple tuple index access expressions `a.0`. Closes #122535.
2024-03-18add non-regression test for issue 122674Rémy Rakic-0/+22
2024-03-16Extend format arg help for simple tuple index access expression许杰友 Jieyou Xu (Joe)-0/+33
2024-02-20Rollup merge of #121241 - reitermarkus:generic-nonzero-traits, r=dtolnayNilstrieb-1/+1
Implement `NonZero` traits generically. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? ````@dtolnay````
2024-02-18macro_rules: Preserve all metavariable spans in a global side tableVadim Petrochenkov-5/+5
2024-02-17Implement `NonZero` traits generically.Markus Reiter-1/+1
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-18/+18
2024-02-13Move testsCaio-0/+29
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-3/+3
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-08Removing redudant note from parse errorMads Ravn-6/+0
2024-01-07Adding alignment to the list of cases to test for specific error message. ↵Mads Ravn-1/+31
Covers `>`, `^` and `<`.
2023-12-13Tweak `short_ty_string` to reduce number of filesEsteban Küber-5/+5
When shortening types and writing them to disk, make `short_ty_string` capable of reusing the same file, instead of writing a file per shortened type.
2023-11-24Show number in error message even for one errorNilstrieb-10/+10
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-06add diagnostic for raw identifiers in format stringLukas Markeffsky-0/+61
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-2/+0
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-11Auto merge of #114507 - sebastiantoh:issue-114235, r=jackh726bors-0/+85
Add suggestion to quote inlined format argument as string literal Fixes #114235
2023-08-09Suggest using `Arc` on `!Send`/`!Sync` typesEsteban Kuber-0/+2
2023-08-05Add suggestion to quote inlined format argument as string literalSebastian Toh-0/+85