]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #45967 - matthewjasper:array-move-types, r=arielb1
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 14 Nov 2017 15:52:12 +0000 (16:52 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2017 15:52:12 +0000 (16:52 +0100)
commit01e979f7b1409a14df6535ca736e65331f3f37f6
tree114fc719d32ad2a2a61302a447894f7a01229648
parent529bb320f7d1c3a049fe5fe8d2542da4fb394dce
parenta6824f18b886d3ca846916fb9bdc188453d2ebe9
Rollup merge of #45967 - matthewjasper:array-move-types, r=arielb1

MIR-borrowck: don't ICE for cannot move from array error

Closes #45694
compile-fail test E0508 now gives
```text
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Ast)
  --> .\src\test\compile-fail\E0508.rs:18:18
   |
18 |     let _value = array[0];  //[ast]~ ERROR E0508
   |                  ^^^^^^^^
   |                  |
   |                  cannot move out of here
   |                  help: consider using a reference instead: `&array[0]`

error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Mir)
  --> .\src\test\compile-fail\E0508.rs:18:18
   |
18 |     let _value = array[0];  //[ast]~ ERROR E0508
   |                  ^^^^^^^^ cannot move out of here

error: aborting due to 2 previous errors
```
src/librustc_mir/borrow_check.rs