about summary refs log tree commit diff
path: root/src/test/ui/nll
AgeCommit message (Collapse)AuthorLines
2019-09-09Auto merge of #63118 - Centril:stabilize-bind-by-move, r=matthewjasperbors-15/+11
Stabilize `bind_by_move_pattern_guards` in Rust 1.39.0 Closes https://github.com/rust-lang/rust/issues/15287. After stabilizing `#![feature(bind_by_move_pattern_guards)]`, you can now use bind-by-move bindings in patterns and take references to those bindings in `if` guards of `match` expressions. For example, the following now becomes legal: ```rust fn main() { let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]); match array { nums // ---- `nums` is bound by move. if nums.iter().sum::<u8>() == 10 // ^------ `.iter()` implicitly takes a reference to `nums`. => { drop(nums); // --------- Legal as `nums` was bound by move and so we have ownership. } _ => unreachable!(), } } ``` r? @matthewjasper
2019-09-08Update test stderr with results of enabling unused lintsMark Rousskov-8/+7
2019-09-08Update tests wrt. bind_by_by_move_pattern_guards stabilization.Mazdak Farrokhzad-15/+11
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-53/+53
2019-08-31Kill borrows from assignments after generating new borrowsMatthew Jasper-0/+20
2019-07-30Remove 'feature(nll)' from bind_by_move_pattern_guards tests.Mazdak Farrokhzad-40/+47
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+204
2019-07-22fix tidylqd-1/+1
2019-07-22Bless output of test nll/loan_ends_mid_block_pair.rs for Polonius, againlqd-24/+1
Fixing assignments to projections made the Polonius output exactly the same as the NLL one.
2019-07-22issue-46589 passes in Polonius and fails in NLL, duplicate it and manually ↵lqd-1/+39
check each outcome
2019-07-22Add test to check that assignments to projections do not kill too many loanslqd-0/+101
2019-07-22Add test checking various assignments are accepted in Poloniuslqd-0/+88
2019-07-22Make both polonius loans tests check-passlqd-2/+2
2019-07-22Rename test so that both "kills-loans" tests match nameslqd-1/+2
2019-07-22Add test extracted from rand, checking that StorageDead kills loanslqd-0/+28
Like "call-kills-loans", Polonius didn't know about some `killed` facts.
2019-07-22Bless output of test nll/return-ref-mut-issue-46557.rs for Poloniuslqd-0/+15
2019-07-22Polonius facts: kill loans on Call terminators and StorageDeadlqd-0/+24
2019-07-22Create a dedicated polonius test folderlqd-0/+0
2019-07-22Bless output of test nll/get_default.rs for Poloniuslqd-0/+15
2 of the 3 errors are "fixed by Polonius" :tada:
2019-07-22Bless output of test nll/loan_ends_mid_block_pair.rs for Poloniuslqd-0/+38
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-09Regression test for issue 42574.Felix S. Klock II-0/+39
2019-07-05Rollup merge of #62133 - petrochenkov:norustc, r=eddybMazdak Farrokhzad-11/+2
Feature gate `rustc` attributes harder Fixes https://github.com/rust-lang/rust/issues/62116
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-41/+41
2019-06-30Make sure `#[rustc_doc_only_macro]` and other rustc attributes are registeredVadim Petrochenkov-11/+2
2019-06-25Fix incorrect double assignment in MIR for while loopsMatthew Jasper-0/+11
2019-06-23Auto merge of #61778 - petrochenkov:pass, r=Mark-Simulacrumbors-3/+2
compiletest: Introduce `// {check,build,run}-pass` pass modes Pass UI tests now have three modes ``` // check-pass // build-pass // run-pass ``` mirroring equivalent well-known `cargo` commands. `// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases). `// build-pass` will compile and link the test without running it. `// run-pass` will compile, link and run the test. Tests without a "pass" annotation are still considered "fail" tests. Most UI tests would probably want to switch to `check-pass`. Tests validating codegen would probably want to run the generated code as well and use `run-pass`. `build-pass` should probably be rare (linking tests?). https://github.com/rust-lang/rust/pull/61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way. Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test. Perhaps some secondary CI can verify this invariant, but that's not super urgent. `// compile-pass` still works and is equivalent to `build-pass`. Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command. It can be removed some time in the future in a separate PR. cc https://github.com/rust-lang/rust/issues/61712
2019-06-21Add test checking our behavior for assigning over a `ConstIndex` projection.Felix S. Klock II-0/+59
2019-06-21Add test that our handling of projections hasn't gone too far:Felix S. Klock II-0/+52
overwriting one field should not allow reborrow of an unrelated field.
2019-06-16compiletest: Remove `skip-codegen`Vadim Petrochenkov-3/+2
2019-06-07Rollup merge of #61332 - kennethbgoodin:borrowck-remove-asterisk-suggestion, ↵Mazdak Farrokhzad-11/+11
r=matthewjasper Remove asterisk suggestion for move errors in borrowck As per the decision in #54985 completely removes the suggestion to add an asterisk when checking move errors. I believe I've preserved the correct behavior with the "consider borrowing here" branch of the original match arm, but I'm not positive on that. This is my first PR to rustc so any feedback is greatly appreciated. Thanks.
2019-06-06Make sure constructors functions are type checked correctlyMatthew Jasper-0/+127
2019-06-04Rollup merge of #61488 - matthewjasper:fix-nll-typeck-ices, r=pnkfelixPietro Albini-0/+205
Fix NLL typeck ICEs * Don't ICE when a type containing a region is constrained by nothing * Don't ICE trying to normalize a type in a `ParamEnv` containing global bounds. To explain what was happening in the `issue-61311-normalize.rs` case: * When borrow checking the `the_fn` in the last `impl` we would try to normalize `Self::Proj` (`<Unit as HasProjFn>::Proj`). * We would find the `impl` that we're checking and and check its `where` clause. * This would need us to check `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` * We find two possible implementations, the blanket impl and the bound in our `ParamEnv`. * The bound in our `ParamEnv` was canonicalized, so we don't see it as a global bound. As such we prefer it to the `impl`. * This means that we cannot normalize `<Box<dyn Obj + 'static> as HasProj>::Proj` to `Unit`. * The `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` bound, which looks like it should be in our `ParamEnv` has been normalized to `Unit: Bound`. * We fail to prove `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`. * We ICE, since we believe typeck have errored. Closes #61311 Closes #61315 Closes #61320 r? @pnkfelix cc @nikomatsakis
2019-06-04Remove asterisk suggestion for move errors in borrowckKenny Goodin-11/+11
As per issue #54985 removes the not useful suggestion to remove asterisk in move errors. Includes minor changes to tests in the `ui` suite to account for the removed suggestion.
2019-06-04Auto merge of #61136 - matthewjasper:cannot-move-errors, r=pnkfelixbors-80/+65
Make cannot move errors more consistent with other borrowck errors * Note the type of the place being moved in all cases. * Note the place being moved from. * Simplify the search for overloaded place operators * Extend the note for move from overloaded deref apply to all types. * Add a note for moves from overloaded index. * Special case moves for closure captures. r? @pnkfelix
2019-06-04Rollup merge of #61446 - czipperz:nll-unused_mut, r=matthewjasperMazdak Farrokhzad-0/+23
On TerminatorKind::DropAndReplace still handle unused_mut correctly Closes #61424 - [x] Todo add regression test
2019-06-03Don't canonicalize `'static` in normalizeMatthew Jasper-0/+194
2019-06-03Update tests for changes to cannot move errorsMatthew Jasper-80/+65
2019-06-03Don't try to lower ReEmpty in NLLMatthew Jasper-0/+11
2019-06-02Use a type implementing DropChris Gregory-2/+18
2019-06-01Add testChris Gregory-0/+7
2019-06-01rustc: collect upvars from HIR, instead of during name resolution.Eduard-Mihai Burtescu-9/+9
2019-05-30Update ui and run-pass for ellipsis_inclusive_range_patterns lintmemoryruins-3/+3
2019-05-29Update ui test suite to use dynmemoryruins-5/+5
2019-05-24Move async/await tests to test/ui/async-awaitvarkor-21/+0
2019-05-21Dont show variables from desugarings in borrowck errorsMatthew Jasper-0/+69
2019-05-17Auto merge of #60171 - matthewjasper:full-nll-compare-mode, r=pnkfelixbors-526/+578
Use -Zborrowck=mir for NLL compare mode closes #56993 r? @pnkfelix
2019-05-13Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelixMazdak Farrokhzad-9/+9
Explain error when yielding a reference to a local variable Closes #56508
2019-05-12Remove feature(nll) when compare mode is sufficientMatthew Jasper-526/+504
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+74