about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-12-22Converted moves-based-on-type-tuple test and added MIR borrowck comparison.David Wood-18/+0
2017-12-22Auto merge of #46752 - Yoric:nll, r=arielb1bors-43/+5
Issue #46589 - Kill borrows on a local variable whenever we assign ov… …er this variable This is a first patch for the issue, handling the simple case while I figure out the data structures involved in the more complex cases.
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-1/+0
Do not emit type errors on recovered blocks When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user. Fix #44579.
2017-12-21Auto merge of #46922 - kennytm:rollup, r=kennytmbors-0/+30
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-1/+0
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-22Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebankkennytm-0/+16
tweaks and fixes for doc(include) This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732): * Turns errors when loading files into full errors. This matches the original RFC text. * Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes. * Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends. * Adds or modifies tests to check for all of these.
2017-12-22Rollup merge of #46780 - varkor:contrib-5, r=arielb1kennytm-0/+14
Fix ICE when calling non-functions within closures The visitor for walking function bodies did not previously properly handle error-cases for function calls. These are now ignored, preventing the panic. This fixes #46771.
2017-12-21Issue #46589 - Kill borrows on a local variable whenever we assign over this ↵David Teller-43/+5
variable
2017-12-21Add a feature gate for nested uses of `impl Trait`Taylor Cramer-2/+41
2017-12-21Auto merge of #46877 - Deewiant:gh46843, r=eddybbors-0/+22
MIR: terminate unreachable blocks in construct_const Fixes #46843. #45821 added unreachable blocks in matches, which were terminated in construct_fn but not in construct_const, causing a panic due to "no terminator on block" when constants involved matching on enums. The "unimplemented expression type" error may go away in the future, the key is that we see the E0015 about using a non-const function and then don't ICE.
2017-12-21Add testsvarkor-0/+8
2017-12-21Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakisbors-4/+30
Implement non-mod.rs mod statements Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660 This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-21Auto merge of #46083 - petrochenkov:morepriv, r=nikomatsakisbors-23/+466
Type privacy polishing Various preparations before implementing https://github.com/rust-lang/rfcs/pull/2145 containing final minor breaking changes (mostly for unstable code or code using `allow(private_in_public)`). (Continuation of https://github.com/rust-lang/rust/pull/42125, https://github.com/rust-lang/rust/pull/44633 and https://github.com/rust-lang/rust/pull/41332.) It would be good to run crater on this. r? @eddyb
2017-12-21Always report private-in-public in associated types as hard errorsVadim Petrochenkov-23/+95
according to RFC 2145. Fix a silly label message.
2017-12-21Prohibit access to private statics from other crates through macros 2.0Vadim Petrochenkov-0/+5
2017-12-21Properly check traits in type privacyVadim Petrochenkov-11/+9
2017-12-21Check associated type bindings for privacy and stabilityVadim Petrochenkov-0/+19
2017-12-21Add tests for associated item privacyVadim Petrochenkov-0/+349
2017-12-20when using feature(nll), don't warn about AST-based region errorsNiko Matsakis-3/+9
Also, keep reporting AST-based region errors that are not occuring in a fn body.
2017-12-20connect NLL machinery to the `NiceRegionError` codeNiko Matsakis-7/+7
2017-12-20Various tweaksEsteban Küber-4/+4
2017-12-20MIR: terminate unreachable blocks in construct_constMatti Niemenmaa-0/+22
Fixes #46843. #45821 added unreachable blocks in matches, which were terminated in construct_fn but not in construct_const, causing a panic due to "no terminator on block" when constants involved matching on enums. The "unimplemented expression type" error may go away in the future, the key is that we see the E0015 about using a non-const function and then don't ICE.
2017-12-20Auto merge of #46733 - nikomatsakis:nll-master-to-rust-master-5, r=arielb1bors-3/+3
nll part 5 Next round of changes from the nll-master branch. Extensions: - we now propagate ty-region-outlives constraints out of closures and into their creator when necessary - we fix a few ICEs that can occur by doing liveness analysis (and the resulting normalization) during type-checking - we handle the implicit region bound that assumes that each type `T` outlives the fn body - we handle normalization of inputs/outputs in fn signatures Not included in this PR (will come next): - handling `impl Trait` - tracking causal information - extended errors r? @arielb1
2017-12-19Implement non-mod.rs mod statementsTaylor Cramer-4/+30
2017-12-19add compile-fail error for external_doc errorsQuietMisdreavus-0/+16
2017-12-19Followup for #46112.Felix S. Klock II-12/+32
Sorting by crate-num should ensure that we favor `std::foo::bar` over `any_other_crate::foo::bar`. Interestingly, *this* change had a much larger impact on our internal test suite than PR #46708 (which was my original fix to #46112).
2017-12-18Add trailing newlinevarkor-1/+1
2017-12-18Fix ICE when calling non-functions within closuresvarkor-0/+14
The visitor for walking function bodies did not previously properly handle error-cases for function calls. These are now ignored, preventing the panic.
2017-12-17remove test for issue #26194 because it is now redundantMichael Hewson-18/+0
2017-12-17update error message in test/compile-fail/issue-26194.rsMichael Hewson-1/+1
2017-12-16Auto merge of #46719 - estebank:issue-39268, r=pnkfelixbors-6/+8
Point at var in short lived borrows instead of drop location For RLS' sake, point at the borrow location as primary span for short lived borrows, instead of the borrow drop location. Fix #39268.
2017-12-15Same change to point at borrow for mir errorsEsteban Küber-6/+8
2017-12-15make `blame_span` deterministicNiko Matsakis-3/+3
2017-12-15Auto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1bors-0/+246
[MIR-borrowck] Two phase borrows This adds limited support for two-phase borrows as described in http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ The support is off by default; you opt into it via the flag `-Z two-phase-borrows` I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs (To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
2017-12-15Auto merge of #46641 - petrochenkov:nohelp2, r=nikomatsakisbors-7928/+22
Move compile-fail tests with NOTE/HELP annotations to UI Remove NOTE/HELP annotations from UI tests cc https://github.com/rust-lang/rust/issues/44844 @oli-obk @est31 r? @nikomatsakis
2017-12-14Auto merge of #45047 - durka:trait-alias, r=petrochenkovbors-0/+27
trait alias infrastructure This will be an implementation of trait aliases (RFC 1733, #41517). Progress so far: - [x] Feature gate - [x] Add to parser - [x] `where` clauses - [x] prohibit LHS type parameter bounds via AST validation https://github.com/rust-lang/rust/pull/45047#discussion_r143575575 - [x] Add to AST and HIR - [x] make a separate PathSource for trait alias contexts https://github.com/rust-lang/rust/pull/45047#discussion_r143353932 - [x] Stub out enough of typeck and resolve to just barely not ICE Postponed: - [ ] Actually implement the alias part - [ ] #21903 - [ ] #24010 I need some pointers on where to start with that last one. The test currently does this: ``` error[E0283]: type annotations required: cannot resolve `_: CD` --> src/test/run-pass/trait-alias.rs:34:16 | 34 | let both = foo(); | ^^^ | = note: required by `foo` ```
2017-12-14Fix rebaseVadim Petrochenkov-0/+33
Update docs for custom normalization of test output
2017-12-14Move compile-fail tests with NOTE/HELP annotations to UIVadim Petrochenkov-7745/+0
2017-12-14Remove NOTE/HELP annotations from error index testsVadim Petrochenkov-216/+22
2017-12-14error for impl trait aliasAlex Burka-1/+3
2017-12-14feature gate trait aliasesAlex Burka-2/+4
2017-12-14error on any use of trait aliasAlex Burka-0/+2
2017-12-14add trait aliases to ASTAlex Burka-0/+21
2017-12-14Auto merge of #45002 - oli-obk:miri, r=eddybbors-2/+13
Validate miri against the HIR const evaluator r? @eddyb cc @alexcrichton @arielb1 @RalfJung The interesting parts are the last few functions in `librustc_const_eval/eval.rs` * We warn if miri produces an error while HIR const eval does not. * We warn if miri produces a value that does not match the value produced by HIR const eval * if miri succeeds and HIR const eval fails, nothing is emitted, but we still return the HIR error * if both error, nothing is emitted and the HIR const eval error is returned So there are no actual changes, except that miri is forced to produce the same values as the old const eval. * This does **not** touch the const evaluator in trans at all. That will come in a future PR. * This does **not** cause any code to compile that didn't compile before. That will also come in the future It would be great if someone could start a crater run if travis passes
2017-12-13Check activation points as the place where mutable borrows become relevant.Felix S. Klock II-11/+72
Since we are now checking activation points, I removed one of the checks at the reservation point. (You can see the effect this had on two-phase-reservation-sharing-interference-2.rs) Also, since we now have checks at both the reservation point and the activation point, we sometimes would observe duplicate errors (since either one independently interferes with another mutable borrow). To deal with this, I used a similar strategy to one used as discussed on issue #45360: keep a set of errors reported (in this case for reservations), and then avoid doing the checks for the corresponding activations. (This does mean that some errors could get masked, namely for conflicting borrows that start after the reservation but still conflict with the activation, which is unchecked when there was an error for the reservation. But this seems like a reasonable price to pay.)
2017-12-13two-phase-reservation-sharing-interference.rs variant that is perhaps more ↵Felix S. Klock II-0/+38
surprising.
2017-12-13test describing a currently unsupported corner case.Felix S. Klock II-0/+46
2017-12-13tests transcribed from nikos blog post.Felix S. Klock II-0/+101
2017-12-13correct comment in testNiko Matsakis-1/+1
2017-12-13fix closure tests now that MIR typeck works properlyNiko Matsakis-5/+4
These tests had FIXMEs for errors that were not previously being reported.