about summary refs log tree commit diff
path: root/tests/ui/fmt
AgeCommit message (Collapse)AuthorLines
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
2023-07-19Improve error message when closing bracket interpreted as formatting fill ↵Michael Goulet-0/+20
character
2023-07-19Fix quotes in outputMichael Goulet-17/+17
2023-06-27Don't sort strings right after we just sorted by typesMichael Goulet-8/+8
2023-05-11Bless tests for portable-simd syncJubilee Young-1/+1
API changes resulted in subtle MIR and impl differences
2023-05-03rustc_middle: Fix `opt_item_ident` for non-local def idsVadim Petrochenkov-4/+8
2023-05-02Rollup merge of #108161 - WaffleLapkin:const_param_ty, r=BoxyUwUDylan DPC-1/+1
Add `ConstParamTy` trait This is a bit sketch, but idk. r? `@BoxyUwU` Yet to be done: - [x] ~~Figure out if it's okay to implement `StructuralEq` for primitives / possibly remove their special casing~~ (it should be okay, but maybe not in this PR...) - [ ] Maybe refactor the code a little bit - [x] Use a macro to make impls a bit nicer Future work: - [ ] Actually™ use the trait when checking if a `const` generic type is allowed - [ ] _Really_ refactor the surrounding code - [ ] Refactor `marker.rs` into multiple modules for each "theme" of markers
2023-04-28fixup tests wrt new normalizationMaybe Waffle-1/+1
2023-04-24Update tests.Mara Bos-19/+19
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-03-27Add test for span of implicit format args captures.Mara Bos-0/+73
2023-03-27Bless UI tests.Mara Bos-9/+9
2023-03-14Properly allow macro expanded `format_args` invocations to uses capturesNilstrieb-19/+144
Originally, this was kinda half-allowed. There were some primitive checks in place that looked at the span to see whether the input was likely a literal. These "source literal" checks are needed because the spans created during `format_args` parsing only make sense when it is indeed a literal that was written in the source code directly. This is orthogonal to the restriction that the first argument must be a "direct literal", not being exanpanded from macros. This restriction was imposed by [RFC 2795] on the basis of being too confusing. But this was only concerned with the argument of the invocation being a literal, not whether it was a source literal (maybe in spirit it meant it being a source literal, this is not clear to me). Since the original check only really cared about source literals (which is good enough to deny the `format_args!(concat!())` example), macros expanding to `format_args` invocations were able to use implicit captures if they spanned the string in a way that lead back to a source string. The "source literal" checks were not strict enough and caused ICEs in certain cases (see # 106191 (the space is intended to avoid spammy backreferences)). So I tightened it up in # 106195 to really only work if it's a direct source literal. This caused the `indoc` crate to break. `indoc` transformed the source literal by removing whitespace, which made it not a "source literal" anymore (which is required to fix the ICE). But since `indoc` spanned the literal in ways that made the old check think that it's a literal, it was able to use implicit captures (which is useful and nice for the users of `indoc`). This commit properly seperates the previously introduced concepts of "source literal" and "direct literal" and therefore allows `indoc` invocations, which don't create "source literals" to use implicit captures again. [RFC 2795]: https://rust-lang.github.io/rfcs/2795-format-args-implicit-identifiers.html#macro-hygiene
2023-02-16Move testsCaio-0/+11
2023-02-07Tweak ICE messageEsteban Küber-1/+1
Modify main message to be more conversational and emit one fewer note.
2023-02-03Rollup merge of #106805 - madsravn:master, r=compiler-errorsMatthias Krüger-0/+69
Suggest `{var:?}` when finding `{?:var}` in inline format strings Link to issue: https://github.com/rust-lang/rust/issues/106572 This is my first PR to this project, so hopefully I can get some good pointers with me from the first PR. Currently my idea was to test out whether or not this is the correct solution to this issue and then hopefully expand upon the idea to not only work for Debug formatting but for all of them. If this is a valid solution, I will create a new issue to give a better error message to a broader range of wrong-order formatting.
2023-02-02PR fixing wrong order of format parameters in strings. Issue #106572Mads Ravn-0/+69
Adding Adding Fixing small issues for PR Adding tests Removing unused binding Changing the wording on note Fixing PR comment
2023-01-30Modify primary span label for E0308Esteban Küber-2/+2
The previous output was unintuitive to users.
2023-01-29Update tests.Mara Bos-3/+3
2023-01-18Revert "Improve heuristics whether `format_args` string is a source literal"Nilstrieb-21/+30
This reverts commit e6c02aad9345925cfed74f86b414c4d0715d381b. Keeps the code improvements from the PR and the test (as a known-bug).
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1891