about summary refs log tree commit diff
path: root/src/test/compile-fail/issue-2149.rs
AgeCommit message (Collapse)AuthorLines
2018-07-15Move some `compile-fail` tests to `ui`Esteban Küber-25/+0
2017-03-30have coercion supply back the target typeNiko Matsakis-1/+1
The `try_coerce` method coerces from a source to a target type, possibly inserting adjustments. It should guarantee that the post-adjustment type is a subtype of the target type (or else that some side-constraint has been registered which will lead to an error). However, it used to return the (possibly adjusted) source as the type of the expression rather than the target. This led to less good downstream errors. To work around this, the code around blocks -- and particular tail expressions in blocks -- had some special case manipulation. However, since that code is now using the more general `CoerceMany` construct (to account for breaks), it can no longer take advantage of that. This lead to some regressions in compile-fail tests were errors were reported at "less good" locations than before. This change modifies coercions to return the target type when successful rather the source type. This extends the behavior from blocks to all coercions. Typically this has limited effect but on a few tests yielded better errors results (and avoided regressions, of course). This change also restores the hint about removing semicolons which went missing (by giving 'force-unit' coercions a chance to add notes etc).
2016-03-09typeck: Unify if-else blocks, match arms and array elements by coercing ↵Eduard Burtescu-1/+1
where possible.
2015-09-26deduplicate trait errors before they are displayedAriel Ben-Yehuda-1/+0
Because of type inference, duplicate obligations exist and cause duplicate errors. To avoid this, only display the first error for each (predicate,span). The inclusion of the span is somewhat bikesheddy, but *is* the more conservative option (it does not remove some instability, as duplicate obligations are ignored by `duplicate_set` under some inference conditions). Fixes #28098 cc #21528 (is it a dupe?)
2015-05-13Fix ICE that occurs when an associated const is ambiguous.Sean Patrick Santos-1/+1
Also change several error messages to refer to "items" rather than "methods", since associated items that require resolution during type checking are not always methods.
2015-03-30Fallout in tests: largely changes to error messages.Niko Matsakis-1/+2
2015-02-04remove all kind annotations from closuresJorge Aparicio-1/+1
2015-02-02Test fixes and rebase conflictsAlex Crichton-1/+1
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-01-05fix cfail testsJorge Aparicio-3/+3
2015-01-03use assoc types in binop traitsJorge Aparicio-1/+0
2014-12-20Allow use of `[_ ; n]` syntax for fixed length and repeating arrays.Nick Cameron-1/+1
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
2014-11-05Implement new operator dispatch semantics.Niko Matsakis-1/+0
Key points are: 1. `a + b` maps directly to `Add<A,B>`, where `A` and `B` are the types of `a` and `b`. 2. Indexing and slicing autoderefs consistently.
2014-10-29Rename fail! to panic!Steve Klabnik-1/+1
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-10-21Patch up broken error messagesNiko Matsakis-0/+1
2014-10-03Change rustc pretty-printing to print [T, ..n] instead of [T, .. n]P1start-1/+1
2014-08-29Introduce new inference scheme: variables are now instantiated with at most ↵Niko Matsakis-1/+1
one type, and region variables are introduced as needed
2014-03-22Remove outdated and unnecessary std::vec_ng::Vec imports.Huon Wilson-1/+0
(And fix some tests.)
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-0/+2
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21test: Automatically remove all `~[T]` from tests.Patrick Walton-3/+3
2013-11-26test: Remove most uses of `&fn()` from the tests.Patrick Walton-2/+2
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-1/+1
Who doesn't like a massive renaming?
2013-10-05testsuite: Two tests for fixed bugsTim Chevalier-2/+1
Closes #7246 Closes #7573
2013-09-30cfail: Remove usage of fmt!Alex Crichton-1/+1
2013-08-03remove obsolete `foreach` keywordDaniel Micay-1/+1
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-1/+1
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-1/+1
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-23vec: remove BaseIter implementationDaniel Micay-1/+1
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-04-30new borrow checker (mass squash)Niko Matsakis-1/+0
2013-04-06librustc: use new `[ty, .. len]` syntax for fixed vector errors.Huon Wilson-1/+1
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-1/+1
notation. rs=delifetiming
2013-03-13librustc: Remove implicit self from the language, except for old-style drop ↵Patrick Walton-2/+2
blocks.
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-2/+2
2013-02-23Fix slice printingoncemoreification-1/+1
2013-02-22Fix vector syntax in error messagesoncemoreification-1/+1
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-1/+1
rs=implflipping
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-15librustc: Make the default sigil for block lambdas `&` instead of `@`.Graydon Hoare-1/+3
2012-12-10Reliciense makefiles and testsuite. Yup.Graydon Hoare-0/+10
2012-12-01Fix some compile-fail testsBrian Anderson-1/+1
2012-11-21Introduce a T_err type for type errorsTim Chevalier-1/+1
This allows more errors to be non-fatal, as per #1871. I only went through and started changing span_fatal to span_err in check.rs. There are probably more errors that could be made non-fatal. So if you see derived type errors appearing from now on, file a bug! r=graydon Closes #1871
2012-09-19demode the each() method on vec and other iterables.Niko Matsakis-1/+1
2012-08-08Convert impls to new syntaxBrian Anderson-1/+1
2012-07-17rustc: Implement and enforce instance coherencePatrick Walton-2/+6
2012-07-02Merge remote-tracking branch 'Dretch/prettydocs'Brian Anderson-2/+2
Conflicts: src/compiletest/errors.rs src/libsyntax/parse/attr.rs src/libsyntax/parse/comments.rs src/test/compile-fail/ambig_impl_unify.rs src/test/compile-fail/assign-super.rs src/test/compile-fail/bad-for-loop.rs src/test/compile-fail/bad-var-env-capture-in-block-arg.rs src/test/compile-fail/block-arg-as-stmt-with-value.rs src/test/compile-fail/borrowck-assign-comp-idx.rs src/test/compile-fail/borrowck-lend-flow.rs src/test/compile-fail/borrowck-loan-blocks-move-cc.rs src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs src/test/compile-fail/borrowck-loan-rcvr.rs src/test/compile-fail/borrowck-loan-vec-content.rs src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs src/test/compile-fail/cap-clause-with-stack-closure.rs src/test/compile-fail/do1.rs src/test/compile-fail/do2.rs src/test/compile-fail/empty-vec-trailing-comma.rs src/test/compile-fail/evec-subtyping.rs src/test/compile-fail/issue-1896.rs src/test/compile-fail/issue-2149.rs src/test/compile-fail/issue-2150.rs src/test/compile-fail/issue-2487-b.rs src/test/compile-fail/kindck-implicit-close-over-mut-var.rs src/test/compile-fail/liveness-issue-2163.rs src/test/compile-fail/liveness-use-in-index-lvalue.rs src/test/compile-fail/no-reuse-move-arc.rs src/test/compile-fail/no-send-res-ports.rs src/test/compile-fail/non-const.rs src/test/compile-fail/pure-higher-order.rs src/test/compile-fail/pure-loop-body.rs src/test/compile-fail/regions-addr-of-upvar-self.rs src/test/compile-fail/regions-escape-loop-via-vec.rs src/test/compile-fail/regions-scoping.rs src/test/compile-fail/seq-args.rs src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs src/test/compile-fail/tstate-unsat-in-fn-expr.rs src/test/compile-fail/vec-add.rs src/test/compile-fail/vec-concat-bug.rs src/test/compile-fail/vector-no-ann.rs
2012-07-01Convert to new closure syntaxBrian Anderson-1/+1
2012-06-30Eliminate usages of old sugared call syntaxBrian Anderson-1/+1
2012-06-30change the test suite `//! kind` syntax to `//~ kind` in order to avoid aGareth Daniel Smith-2/+2
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
2012-06-29Switch the compiler over to using ~[] notation instead of []/~. Closes #2759.Michael Sullivan-2/+2