about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-05-16 03:16:18 +0800
committerkennytm <kennytm@gmail.com>2017-05-17 16:09:39 +0800
commitb384b18d5d2417616d043602fd023ee48fd4b934 (patch)
tree97da3a6afcf27a723790313a2e19a3a52892bc2b /src/rustllvm/RustWrapper.cpp
parent42e3732d7d9c5e3d253082faa09ea348d1a0a309 (diff)
downloadrust-b384b18d5d2417616d043602fd023ee48fd4b934.tar.gz
rust-b384b18d5d2417616d043602fd023ee48fd4b934.zip
Refactor: Move the mutable parts out of LintStore. Fix #42007.
* #42007 happens because the Session LintStore is emptied when linting.
* The Session LintStore is emptied because the checker (Early/LateContext)
  wants ownership.
* The checker wants ownership because it wants to mutate the pass objects
  and lint levels.

The ownership of the whole store is not essential, only the lint levels and
pass objects need to be owned. Therefore, these parts are extracted out of
the LintStore into a separate structure `LintSession`. The "check crates"
methods can operate on `&mut LintSession` instead of `&mut LintStore`.

This is a minor BREAKING CHANGE for lint writers since the `LintContext`
trait is changed: the `mut_lints` and `level_stack` methods are removed.
But no one outside of `librustc/lint/context.rs` is using these functions,
so it should be safe.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions