diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-10-03 00:31:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-03 00:31:12 +0200 |
| commit | 65228686649c68f491d3b763e9dde52c23fea9d7 (patch) | |
| tree | f2868cb1c2c8fb3c56235745a1232c4b76b7501a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | ccc020ab42b4209940b821ba4fd0e1240d3f7561 (diff) | |
| parent | 804d159c6276025e26ade90a6ef013bda33207c3 (diff) | |
| download | rust-65228686649c68f491d3b763e9dde52c23fea9d7.tar.gz rust-65228686649c68f491d3b763e9dde52c23fea9d7.zip | |
Rollup merge of #77251 - dtolnay:drop, r=Aaron1011
Bypass const_item_mutation if const's type has Drop impl
Follow-up to #75573. This PR disables the const_item_mutation lint in cases that the const has a Drop impl which observes the mutation.
```rust
struct Log { msg: &'static str }
const LOG: Log = Log { msg: "" };
impl Drop for Log {
fn drop(&mut self) { println!("{}", self.msg); }
}
LOG.msg = "wow"; // prints "wow"
```
r? @Aaron1011
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
