about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-07 17:57:30 +0000
committerbors <bors@rust-lang.org>2020-08-07 17:57:30 +0000
commit09f4c9f5082f78b0adcee83d3ab4337e000cd28e (patch)
treea9e5933ed9ccf01acc3f85574fbe7ecf3e036704 /src/rustllvm/RustWrapper.cpp
parent4d4342347b71313258a46e506ee0a258f365185c (diff)
parentac50d61785ae5112b9b4e30a58cfcffe096b31ec (diff)
downloadrust-09f4c9f5082f78b0adcee83d3ab4337e000cd28e.tar.gz
rust-09f4c9f5082f78b0adcee83d3ab4337e000cd28e.zip
Auto merge of #75255 - davidtwco:polymorphisation-symbol-mangling-v0-upvar-closures, r=lcnr
instance: polymorphize upvar closures/generators

This PR modifies how instances are polymorphized so that closures and generators have any closures or generators captured within their upvars also polymorphized.

With the new symbol mangling, a fully polymorphised closure will produce the same symbol regardless of what it was instantiated with. However, when that polymorphised closure captures another closure as an upvar, then the type of that other closure in the upvar substitution wouldn't have been polymorphised. The other closure will still refer to the initial substitutions. Therefore, the polymorphised closure will end up hashing differently but producing the same symbol - triggering `assert_symbols_are_distinct` in MIR partitioning. The old mangling scheme had a hash at the end that meant this didn't happen (this would still have been an issue, we just didn't have a way to notice).

See [this Zulip discussion for further elaboration](https://rust-lang.zulipchat.com/#narrow/stream/216091-t-compiler.2Fwg-polymorphization/topic/symbol.20mangling.20v0.20.E2.9C.95.20polymorphisation/near/206152008).

r? @eddyb
cc @lcnr
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions