about summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-vec-pattern-nesting.rs
AgeCommit message (Collapse)AuthorLines
2016-02-24Move the borrowck run-pass/compile-fail tests into their own directoriesNiko Matsakis-78/+0
as a test.
2015-03-27Feature gate *all* slice patterns. #23121Brian Anderson-0/+1
Until some backwards-compatibility hazards are fixed in #23121, these need to be unstable. [breaking-change]
2015-02-11Opt into `box_patterns` feature gate in all tests that use them.Felix S. Klock II-0/+1
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-4/+4
2015-01-31Kill more `isize`sTobias Bucher-5/+5
2015-01-08Update compile-fail tests to use is/us, not i/u.Huon Wilson-5/+5
2015-01-08Update compile fail tests to use isize.Huon Wilson-4/+4
2015-01-08compile-fail tests: Add feature attributes to enable box pat/expr syntax in ↵Felix S. Klock II-0/+1
various tests.
2014-09-09rollup merge of #17054 : pcwalton/subslice-syntaxAlex Crichton-3/+3
2014-09-08librustc: Change the syntax of subslice matching to use postfix `..`Patrick Walton-3/+3
instead of prefix `..`. This breaks code that looked like: match foo { [ first, ..middle, last ] => { ... } } Change this code to: match foo { [ first, middle.., last ] => { ... } } RFC #55. Closes #16967. [breaking-change]
2014-09-08librustc: Feature gate subslice matching in non-tail positions.Patrick Walton-0/+1
This breaks code that uses the `..xs` form anywhere but at the end of a slice. For example: match foo { [ 1, ..xs, 2 ] [ ..xs, 1, 2 ] } Add the `#![feature(advanced_slice_patterns)]` gate to reenable the syntax. RFC #54. Closes #16951. [breaking-change]
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-5/+5
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-12/+13
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-09Collect move errors before reportingKiet Tran-7/+8
This commit changes the way move errors are reported when some value is captured by a PatIdent. First, we collect all of the "cannot move out of" errors before reporting them, and those errors with the same "move source" are reported together. If the move is caused by a PatIdent (that binds by value), we add a note indicating where it is and suggest the user to put `ref` if they don't want the value to move. This makes the "cannot move out of" error in match expression nicer (though the extra note may not feel that helpful in other places :P). For example, with the following code snippet, ```rust enum Foo { Foo1(~u32, ~u32), Foo2(~u32), Foo3, } fn main() { let f = &Foo1(~1u32, ~2u32); match *f { Foo1(num1, num2) => (), Foo2(num) => (), Foo3 => () } } ``` Errors before the change: ```rust test.rs:10:9: 10:25 error: cannot move out of dereference of `&`-pointer test.rs:10 Foo1(num1, num2) => (), ^~~~~~~~~~~~~~~~ test.rs:10:9: 10:25 error: cannot move out of dereference of `&`-pointer test.rs:10 Foo1(num1, num2) => (), ^~~~~~~~~~~~~~~~ test.rs:11:9: 11:18 error: cannot move out of dereference of `&`-pointer test.rs:11 Foo2(num) => (), ^~~~~~~~~ ``` After: ```rust test.rs:9:11: 9:13 error: cannot move out of dereference of `&`-pointer test.rs:9 match *f { ^~ test.rs:10:14: 10:18 note: attempting to move value to here (to prevent the move, you can use `ref num1` to capture value by reference) test.rs:10 Foo1(num1, num2) => (), ^~~~ test.rs:10:20: 10:24 note: and here (use `ref num2`) test.rs:10 Foo1(num1, num2) => (), ^~~~ test.rs:11:14: 11:17 note: and here (use `ref num`) test.rs:11 Foo2(num) => (), ^~~ ``` Close #8064
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-4/+4
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21test: Automatically remove all `~[T]` from tests.Patrick Walton-4/+4
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-7/+12
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-11test -- update tests with new error messagesNiko Matsakis-2/+2
2014-02-07Added tests to make tidyDerek Guenther-0/+10
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-1/+1
Who doesn't like a massive renaming?
2013-09-30cfail: Remove usage of fmt!Alex Crichton-1/+1
2013-08-07Fix incorrect non-exhaustive matching for fixed length vecsStepan Koltsov-7/+7
Code like this is fixed now: ``` fn foo(p: [u8, ..4]) { match p { [a, b, c, d] => {} }; } ``` Invalid constructors are not reported as errors yet: ``` fn foo(p: [u8, ..4]) { match p { [_, _, _] => {} // this should be error [_, _, _, _, _, .._] => {} // and this _ => {} } } ``` Issue #8311 is partially fixed by this commit. Fixed-length arrays in let statement are not yet allowed: ``` let [a, b, c] = [1, 2, 3]; // still fails ```
2013-07-08Update existing tests to account for stricter, more correct handling of ↵Niko Matsakis-0/+37
irrefutable patterns
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-1/+1
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-1/+0
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+0
2013-04-30new borrow checker (mass squash)Niko Matsakis-2/+2
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-1/+1
2013-02-01Remove fail keyword from lexer & parser and clean up remaining calls toNick Desaulniers-1/+1
fail Fix merge conflicts - Issue 4524
2013-01-28Integrate vec patterns into borrow checker.Niko Matsakis-0/+21
The tail portion of the pattern effectively borrows a vector, but the borrow checker knew nothing about this. r=catamorphism