about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-08-01 21:46:26 +0200
committerGitHub <noreply@github.com>2018-08-01 21:46:26 +0200
commitd5fcd27eb9b79d7e191d39289aaffd6277312ed2 (patch)
tree73eaec31d5ce282c3f3ec04cf8cb1a12526d4ff5 /src/rustllvm/PassWrapper.cpp
parent4d1ddfe9833b1d179cac07d7718f626f81e09bad (diff)
parent84dc48522d71ec4531219927155b20c2eadbae70 (diff)
downloadrust-d5fcd27eb9b79d7e191d39289aaffd6277312ed2.tar.gz
rust-d5fcd27eb9b79d7e191d39289aaffd6277312ed2.zip
Rollup merge of #52834 - matthewjasper:allow-zst-conflicts, r=pnkfelix
[NLL] Allow conflicting borrows of promoted length zero arrays

This is currently overkill as there's no way to create two conflicting borrows of any promoted.
It is possible that the following code might not fail due to const eval in the future (@oli-obk?). In which case either the array marked needs to not be promoted, or to be checked for conflicts

```rust
static mut A: () = {
    let mut y = None;
    let z;
    let mut done_y = false;
    loop {
        let x = &mut [1];  // < this array
        if done_y {
            z = x;
            break;
        }
        y = Some(x);
        done_y = true;
    }
    some_const_fn(y, z); // some_const_fn expects that y to not alias z.
};
```

r? @pnkfelix  @nikomatsakis

closes #52671
cc #51823
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions