summary refs log tree commit diff
path: root/src/test/ui/pattern
AgeCommit message (Collapse)AuthorLines
2019-11-03Auto merge of #65759 - tmiasko:ui, r=petrochenkovbors-2/+2
Validate error patterns and error annotation in ui tests when present Previously, when compilation succeeded, neither error patterns nor error annotation would be validated. Additionally, when compilation failed, only error patterns would be validated if both error patterns and error annotation were present. Now both error patterns and error annotation are validated when present, regardless of compilation status. Furthermore, for test that should run, the error patterns are matched against executable output, which is what some of tests already expect to happen, and when #65506 is merged even more ui tests will. Fixes #56277
2019-11-02Update error annotations in tests that successfully compileTomasz Miąsko-2/+2
Those annotation are silently ignored rather than begin validated against compiler output. Update them before validation is enabled, to avoid test failures.
2019-10-31Revert "pre-expansion gate box_patterns"Eduard-Mihai Burtescu-2/+0
This reverts commit 2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.
2019-10-28Auto merge of #65421 - estebank:variants, r=petrochenkovbors-2/+5
Point at local similarly named element and tweak references to variants Partially address #65386.
2019-10-27Gather together usefulness testsNadrieril-0/+2036
I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder.
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-2/+5
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-24pre-expansion gate box_patternsMazdak Farrokhzad-0/+2
2019-09-26Adjust & --bless tests due to no longer downgrading NLL errors on 2015.Mazdak Farrokhzad-31/+3
2019-09-24Remove blanket silencing of "type annotation needed" errorsEsteban Küber-15/+23
Remove blanket check for existence of other errors before emitting "type annotation needed" errors, and add some eager checks to avoid adding obligations when they refer to types that reference `[type error]` in order to reduce unneded errors.
2019-09-04Point at variant on pattern field count mismatchEsteban Küber-0/+9
2019-07-29Add semantic test for rest patterns.Mazdak Farrokhzad-0/+270
2019-07-29Add syntactic test for rest patterns.Mazdak Farrokhzad-0/+70
2019-07-01Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, ↵bors-43/+0
r=petrochenkov Stabilize `type_alias_enum_variants` in Rust 1.37.0 Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write: ```rust enum Option<T> { None, Some(T), } type OptAlias<T> = Option<T>; fn work_on_alias(x: Option<u8>) -> u8 { match x { OptAlias::Some(y) => y + 1, OptAlias::None => 0, } } ``` Closes https://github.com/rust-lang/rfcs/issues/2218 Closes https://github.com/rust-lang/rust/issues/52118 r? @petrochenkov
2019-06-18test: normalize away the line/column info in ui/pattern/const-pat-ice.Eduard-Mihai Burtescu-1/+2
2019-06-15Move type_alias_enum_variants tests to a folder; Strip feature gates.Mazdak Farrokhzad-43/+0
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-1/+1
2019-06-05Reblessed tests.Alexander Regueiro-1/+1
2019-05-25Update ui testsOliver Scherer-1/+1
2019-05-25Make `ConstValue::Slice` solely take `[u8]` and `str`Oliver Scherer-18/+6
2019-05-21Add FAQ for NLL migrationJethro Beekman-0/+1
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+22
2019-05-10Fix inhabitedness of non-exhaustive variants.David Wood-1/+1
This commit ensures that non-exhaustive variants are considered inhabited when used in extern crates.
2019-04-22Fix ICE related to #53708Esteban Küber-1/+1
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-1/+20
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-3/+3
2019-04-14normalize flags and rustc version in ICE reproRalf Jung-2/+4
2019-04-14fix testsRalf Jung-0/+13
2019-03-27Better diagnostic for binary operation on BoxedValueshgallagher1993-2/+4
2019-03-11Update testsVadim Petrochenkov-34/+34
2019-01-15Rollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichtonMazdak Farrokhzad-0/+1
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
2019-01-14Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavisMazdak Farrokhzad-1/+1
clarify resolve typo suggestion Include the kind of the binding that we're suggesting, and use a structured suggestion. Fixes #53445.
2019-01-14Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice testAaron Hill-0/+1
This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
2019-01-13Rollup merge of #57366 - estebank:point-match-discrim, r=varkorMazdak Farrokhzad-0/+4
Point at match discriminant on type error in match arm pattern ``` error[E0308]: mismatched types --> src/main.rs:5:9 | 4 | let temp: usize = match a + b { | ----- this expression has type `usize` 5 | Ok(num) => num, | ^^^^^^^ expected usize, found enum `std::result::Result` | = note: expected type `usize` found type `std::result::Result<_, _>` ``` Fix #57279.
2019-01-12Reword label as per review commentEsteban Küber-2/+2
2019-01-12Point at the match discriminant when arm pattern has a type mismatchEsteban Küber-0/+4
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-0/+85
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-09clarify resolve typo suggestionAndy Russell-1/+1
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2018-12-25Remove licensesMark Rousskov-126/+26
2018-12-24make non_camel_case_types an early lintAndy Russell-13/+11
2018-12-15Auto merge of #56540 - oli-obk:less_const_hackery, r=varkorbors-12/+158
Don't depend on `Allocation` sizes for pattern length And generally be more explicit about shortcomings of the implementation cc @RalfJung
2018-12-13Update tests to show diagnosticsOliver Scherer-19/+128
2018-12-11Fix irrefutable matches on integer rangesvarkor-0/+8
2018-12-10Add a few more tests of edge casesOliver Scherer-0/+37
2018-11-29Fix another related ICEOliver Scherer-1/+40
2018-11-29r/\t/ /Oliver Scherer-21/+21
2018-11-29Support arbitrary slice constants for pattern deaggregationOliver Scherer-2/+24
2018-11-29Allow constants of byte slice type as patternsOliver Scherer-0/+11
2018-11-18resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-4/+4
2018-11-18resolve: Tweak some articles in ambiguity diagnosticsVadim Petrochenkov-9/+9
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+542