about summary refs log tree commit diff
path: root/src/test/ui/pattern
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-14295/+0
2023-01-01Verbose suggestionsEsteban Küber-6/+10
2022-12-28Use verbose suggestions for mutability errorsEsteban Küber-6/+10
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-4/+4
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-13review commentsEsteban Küber-6/+6
2022-12-13Rollup merge of #105500 - oli-obk:unhide_unknown_spans, r=estebankMatthias Krüger-37/+12
Make some diagnostics not depend on the source of what they reference being available r? `@estebank` follow up to https://github.com/rust-lang/rust/pull/104449
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-6/+6
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-2/+2
2022-12-13Suggest `ref` for some patterns as a fallbackEsteban Küber-13/+46
2022-12-13Avoid rendering empty annotationsOli Scherer-9/+17
2022-12-13Don't emit empty notesOli Scherer-13/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-36/+15
available
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-1/+1
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-23Account for `x @ y` and suggest `ref x @ ref y`Esteban Küber-16/+181
2022-11-23Suggest `.clone()` or `ref binding` on E0382Esteban Küber-4/+96
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-21/+3
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-21Simplify testOli Scherer-3/+1
Co-authored-by: lcnr <rust@lcnr.de>
2022-11-21Fix an ICE that I just made worseOli Scherer-0/+28
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-21/+3
2022-11-20Change to Ty::is_inhabited_fromCameron Steffen-1/+1
2022-11-12Move testsCaio-0/+25
2022-10-13Move some tests to more reasonable directoriesCaio-0/+33
2022-10-01bless ui testsMaybe Waffle-4/+4
2022-09-27add a label to struct/enum/union ident nameTakayuki Maeda-0/+2
2022-09-15Remove the let_else feature gate from the testsuiteest31-14/+12
Result of running: rg -l "feature.let_else" src/test/ | xargs sed -s -i "s#^...feature.let_else..\$##" Plus manual tidy fixes.
2022-09-15Remove feature gate from let else suggestionest31-2/+2
The let else suggestion added by 0d92752b8aac53e033541d04fc7d9677d8bca227 does not need a feature gate any more.
2022-09-13Rebase fallout.Camille GILLOT-12/+8
2022-09-08Rollup merge of #101399 - cjgillot:borrowck-binding-span, r=estebankDylan DPC-154/+103
Shrink span for bindings with subpatterns. Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern. This PR proposes to shrink the span to stop before the ````@`.``` This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat. r? ```@estebank```
2022-09-06Shrink span for bindings with subpatterns.Camille GILLOT-154/+103
2022-09-03Include enum path in variant suggestionMichael Goulet-180/+180
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-21Note closure kind mismatch causeMichael Goulet-3/+27
2022-08-21Rework point-at-argMichael Goulet-3/+3
2022-08-17Reenable early feature-gates as future-compat warningsChristopher Durham-1/+28
2022-08-09suggest adding an appropriate missing pattern excluding commentsTakayuki Maeda-0/+43
2022-07-09Rollup merge of #99008 - obeis:issue-98974, r=compiler-errorsDylan DPC-4/+16
Adding suggestion for E0530 Closes #98974
2022-07-08Update ui test for the new E0530 suggestionObei Sideg-4/+16
2022-07-07Shorten span for closures.Camille GILLOT-1/+1
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-6/+6
2022-07-01Auto merge of #98781 - GuillaumeGomez:rollup-798kb8u, r=GuillaumeGomezbors-3/+3
Rollup of 5 pull requests Successful merges: - #97249 (`<details>`/`<summary>` UI fixes) - #98418 (Allow macOS to build LLVM as shared library) - #98460 (Use CSS variables to handle theming) - #98497 (Improve some inference diagnostics) - #98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - #98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Only label place where type is needed if span is meaningfulMichael Goulet-3/+3
2022-07-01Shorten def_span for more items.Camille GILLOT-105/+57
2022-06-24improve wording of a suggestionMaybe Waffle-1/+1
2022-06-23Suggest defining variable as mutable on `&mut _` type mismatch in patsMaybe Waffle-0/+5
2022-06-19Be more hygenic with spansMichael Goulet-56/+38
2022-06-19Only omit trailing comma if block doesn't come from macro expansionMichael Goulet-1/+1
2022-06-16bless clippy testsklensy-1/+1
2022-06-16Rollup merge of #97964 - WaffleLapkin:fix_borrow_par_suggestions, ↵Yuki Okushi-1/+5
r=compiler-errors Fix suggestions for `&a: T` parameters I've accidentally discovered that we have broken suggestions for `&a: T` parameters: ```rust fn f(&mut bar: u32) {} fn main() { let _ = |&mut a| (); } ``` ```text error[E0308]: mismatched types --> ./t.rs:1:6 | 1 | fn f(&mut bar: u32) {} | ^^^^^^^^----- | | | | | expected due to this | expected `u32`, found `&mut _` | help: did you mean `bar`: `&u32` | = note: expected type `u32` found mutable reference `&mut _` error[E0308]: mismatched types --> ./t.rs:4:23 | 4 | let _: fn(u32) = |&mut a| (); | ^^^^^-- | | | | | expected due to this | expected `u32`, found `&mut _` | help: did you mean `a`: `&u32` | = note: expected type `u32` found mutable reference `&mut _` ``` It's hard to see, but 1. The help span is overlapping with "expected" spans 2. It suggests `fn f( &u32) {}` (no `mut` and lost parameter name) and `|&u32 ()` (no closing `|` and lost parameter name) I've tried to fix this. r? ``@compiler-errors``
2022-06-10Fix suggestions for `&a: T` parametersMaybe Waffle-1/+5
Previously we were suggesting stuff like `fn f( &u32) {}`
2022-06-10Bless tests.Camille GILLOT-92/+84