about summary refs log tree commit diff
path: root/src/test/ui/pattern
AgeCommit message (Collapse)AuthorLines
2020-09-02pretty: trim paths of unique symbolsDan Aloni-132/+132
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-09-01Clarify message about unresolved useKornel-3/+3
2020-08-30mv compiler to compiler/mark-1/+1
2020-08-02Auto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkovbors-0/+95
Fix ICEs with `@ ..` binding This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken. The diagnostics are verbose though, it fixes three related issues. cc #74954, #74539, and #74702
2020-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-2/+2
2020-07-31Fix ICEs with `@ ..` bindingYuki Okushi-0/+95
2020-07-27mv std libs to library/mark-3/+3
2020-07-07Update reference to CONTRIBUTING.mdYuki Okushi-1/+1
2020-07-05Address code reviewsYuki Okushi-10/+21
2020-07-05Explain exhaustive matching on {usize,isize} maximum valuesYuki Okushi-0/+46
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-31/+31
propagation
2020-06-24Provide suggestions for some moved value errorsEsteban Küber-0/+24
When encountering an used moved value where the previous move happened in a `match` or `if let` pattern, suggest using `ref`. Fix #63988. When encountering a `&mut` value that is used in multiple iterations of a loop, suggest reborrowing it with `&mut *`. Fix #62112.
2020-06-13Prefer the associated consts for pattern matching errorLzu Tao-25/+25
2020-05-29Rollup merge of #72572 - JohnTitor:add-tests, r=matthewjasperDylan DPC-0/+17
Add some regression tests Closes #68532 Closes #70121 Closes #71042 CC #56445 r? @matthewjasper since they (except for #71042) are related to #72362.
2020-05-27Add test for #71042Yuki Okushi-0/+17
2020-05-23Remove out-of-date commentNadrieril-1/+0
2020-05-23Work around type normalization issuesNadrieril-0/+23
2020-05-17We don't use tyerr anymoreNadrieril-0/+22
This however unearthed a bug, hence the FIXME and the workaround.
2020-04-11rustc: Add a warning count upon completionRoccoDev-1/+6
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-27/+12
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+108
2020-03-25borrowck: prefer "value" over "`_`".Mazdak Farrokhzad-41/+41
2020-03-23Ignore tests on some platforms due to #53081Aaron Hill-12/+27
2020-03-22Store idents for `DefPathData` into crate metadataAaron Hill-0/+18
Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-03-17Update tests for erasing regions in typeckMatthew Jasper-2/+2
2020-03-04test(pattern): harden tests for or-patterns with slice-patternsMatthew Kuo-2/+15
Some of the nested OR paths were being missed
2020-03-04test(pattern): add tests for combinations of pattern featuresMatthew Kuo-0/+204
Reference issue #67311 Tests combinations of the following pattern features: - bindings_after_at - or_patterns - slice_patterns - box_patterns
2020-02-25check_pat_tuple: use pattern_causeMazdak Farrokhzad-0/+7
2020-02-25check_pat_path: use pattern_causeMazdak Farrokhzad-0/+2
2020-02-21Fix error messageLeSeulArtichaut-33/+33
Bless tests
2020-02-17Do not emit note suggesting to implement trait to foreign typeLeSeulArtichaut-2/+0
Update tests Extend to other operations Refractor check in a separate function Fix more tests
2020-02-11Auto merge of #68929 - matprec:consistent-issue-references, r=Dylan-DPCbors-5/+5
Make issue references consistent Fixes https://github.com/rust-lang/rust/issues/62976 cc https://github.com/rust-lang/rust/pull/63008 r? @varkor because you reviewed the original pr
2020-02-09--bless --compare-mode=nllMatthias Prechtl-5/+5
2020-02-09Don't parse `mut a @ b` as `mut a @ mut b`Matthew Jasper-0/+75
2020-02-09Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasperbors-636/+2686
Initial implementation of `#![feature(move_ref_pattern)]` Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary. Closes #45600. Tracking issue: #68354. r? @matthewjasper
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+1
2020-02-02move_ref_pattern: test captures inside closureMazdak Farrokhzad-0/+526
2020-02-02move_ref_pattern: change pov in diagnostics & add binding namesMazdak Farrokhzad-457/+457
2020-02-02move_ref_pattern: don't ICE on unreachable 2xby-move conflictsMazdak Farrokhzad-0/+15
2020-02-02move_ref_patterns: introduce testsMazdak Farrokhzad-401/+1910
bindings_after_at: harden tests
2020-02-01Remove or_patterns from INCOMPLETE_FEATURESMatthew Jasper-19/+10
2020-01-24Normalise notes with the/isvarkor-18/+18
2020-01-20check_match: simplify check_armMazdak Farrokhzad-1/+3
2020-01-20check_match: unify some lowering code and fix some ICEsMazdak Farrokhzad-0/+77
2020-01-18slice_patterns: organize some testsMazdak Farrokhzad-1/+1
2020-01-18slice_patterns: remove gates in testsMazdak Farrokhzad-194/+172
2020-01-12Diagnostics should not end with a full stopvarkor-1/+1
2020-01-12Split `rustc_mir::{build, hair, lints}` into their own crateMatthew Jasper-1/+1
2020-01-09Update testsVadim Petrochenkov-16/+63
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-0/+2
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors