about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2021-11-15 16:23:02 +0100
committerKrasimir Georgiev <krasimir@google.com>2021-11-15 16:23:02 +0100
commitc1c20138a9c895fe285c864b432472438ff978fd (patch)
tree31e0afedf31cf6101aac1cadd12f361ca6f0f6c4 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent68ca579406f2fa9ec62710e4a4d5d3e07a168d3c (diff)
downloadrust-c1c20138a9c895fe285c864b432472438ff978fd.tar.gz
rust-c1c20138a9c895fe285c864b432472438ff978fd.zip
rustc_mir_build: reorder bindings
No functional changes intended.

I'm playing around with building compiler components using nightly rust
(2021-11-02) in a non-standard way. I encountered the following error while
trying to build rustc_mir_build:

```
error[E0597]: `wildcard` does not live long enough
    --> rust/src/nightly/compiler/rustc_mir_build/src/build/matches/mod.rs:1767:82
     |
1767 |         let mut otherwise_candidate = Candidate::new(expr_place_builder.clone(), &wildcard, false);
     |                                                                                  ^^^^^^^^^ borrowed value does not live long enough
...
1799 |     }
     |     -
     |     |
     |     `wildcard` dropped here while still borrowed
     |     borrow might be used here, when `guard_candidate` is dropped and runs the destructor for type `Candidate<'_, '_>`
     |
     = note: values in a scope are dropped in the opposite order they are defined
```

I believe this flags an issue that may become an error in the future.
Swapping the order of `wildcard` and `guard_candidate` resolves it.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions