about summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs
AgeCommit message (Collapse)AuthorLines
2016-02-24Move the borrowck run-pass/compile-fail tests into their own directoriesNiko Matsakis-44/+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-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-3/+3
2015-01-08Update compile fail tests to use isize.Huon Wilson-6/+6
2014-10-29Rename fail! to panic!Steve Klabnik-3/+3
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
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/+2
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-07-19librustc: Implement lifetime elision.Patrick Walton-3/+3
This implements RFC 39. Omitted lifetimes in return values will now be inferred to more useful defaults, and an error is reported if a lifetime in a return type is omitted and one of the two lifetime elision rules does not specify what it should be. This primarily breaks two uncommon code patterns. The first is this: unsafe fn get_foo_out_of_thin_air() -> &Foo { ... } This should be changed to: unsafe fn get_foo_out_of_thin_air() -> &'static Foo { ... } The second pattern that needs to be changed is this: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed { Owned(format!("hello world")) } Change code like this to: enum MaybeBorrowed<'a> { Borrowed(&'a str), Owned(String), } fn foo() -> MaybeBorrowed<'static> { Owned(format!("hello world")) } Closes #15552. [breaking-change]
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-3/+3
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21test: Automatically remove all `~[T]` from tests.Patrick Walton-3/+3
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-3/+6
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-07Added tests to make tidyDerek Guenther-0/+10
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-09-30cfail: Remove usage of fmt!Alex Crichton-3/+3
2013-08-07Fix incorrect non-exhaustive matching for fixed length vecsStepan Koltsov-3/+3
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-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-3/+3
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-04-30new borrow checker (mass squash)Niko Matsakis-6/+6
2013-03-11Implement vector destructuring from tailSeo Sanghyeon-7/+20
2013-02-15tests/tutorials: Get rid of `move`.Luqman Aden-1/+1
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-1/+1
2013-01-31Replace most invocations of fail keyword with die! macroNick Desaulniers-1/+1
2013-01-28Integrate vec patterns into borrow checker.Niko Matsakis-0/+15
The tail portion of the pattern effectively borrows a vector, but the borrow checker knew nothing about this. r=catamorphism