diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-04-21 05:15:53 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-05-31 19:41:25 -0400 |
| commit | 52b2db1cca591a14b9790ce3d11fba39696ae4a7 (patch) | |
| tree | d204e1c7999e6c179507086778bf8f4147499400 /src/rustllvm/RustWrapper.cpp | |
| parent | 08034eb1a58518f7fc684ad325d32195d48a9fe3 (diff) | |
| download | rust-52b2db1cca591a14b9790ce3d11fba39696ae4a7.tar.gz rust-52b2db1cca591a14b9790ce3d11fba39696ae4a7.zip | |
warn if leak-check relies on LBRs that will change
When we do a "HR subtype" check, we replace all late-bound regions (LBR)
in the subtype with fresh variables, and skolemize the late-bound
regions in the supertype. If those skolemized regions from the supertype
wind up being super-regions (directly or indirectly) of either
- another skolemized region; or,
- some region that pre-exists the HR subtype check
- e.g., a region variable that is not one of those created
to represent bound regions in the subtype
then the subtype check fails.
What will change when we fix #32330 is that some of the LBR in the
subtype may become early-bound. In that case, they would no longer be in
the "permitted set" of variables that can be related to a skolemized
type.
So the foundation for this warning is to collect variables that we found
to be related to a skolemized type. For each of them, we have a
`BoundRegion` which carries a `Issue32330` flag. We check whether any of
those flags indicate that this variable was created from a lifetime
that will change from late- to early-bound. If so, we issue a warning
indicating that the results of compilation may change.
This is imperfect, since there are other kinds of code that will not
compile once #32330 is fixed. However, it fixes the errors observed in
practice on crater runs.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
